runceel / ReactiveProperty

ReactiveProperty provides MVVM and asynchronous support features under Reactive Extensions. Target frameworks are .NET 6+, .NET Framework 4.7.2 and .NET Standard 2.0.
MIT License
903 stars 101 forks source link

ReactiveCommandSlim implements T as nullable #429

Closed espenrl closed 1 year ago

espenrl commented 1 year ago

ReactiveCommandSlim differs from ReactiveCommand in that it implements generic T as nullable. In combination with C# nullability analysis that forces a lot of additional null handling which isn't necessary and pollutes the code.

https://github.com/runceel/ReactiveProperty/blob/6a6890c826776d5b3f25f41b61106d1d7f667dab/Source/ReactiveProperty.NETStandard/ReactiveCommand.cs#L64

https://github.com/runceel/ReactiveProperty/blob/6a6890c826776d5b3f25f41b61106d1d7f667dab/Source/ReactiveProperty.Core/ReactiveCommandSlim.cs#L68

runceel commented 1 year ago

I have released a new pre-release package to NuGet to fix this issue. https://www.nuget.org/packages/ReactiveProperty/9.3.0-pre202307291429

Could you check this package?

espenrl commented 1 year ago

@runceel it works perfectly. Thank you for fixing it.

I have an MAUI app which uses the ReactiveProperty library extensively and I changed all ReactiveProperty and ReactiveCommand to their slim counterparts. No nullability issues this time - it was a straight forward swap.

runceel commented 1 year ago

@espenrl Thank you for checking it. I will publish the package as release version (not pre-release). After that, I close this issue.

runceel commented 1 year ago

I published the package. Thank you for using ReactiveProperty and feedback!!

If you noticed something, feel free create or re-open issue. 😀