alexnoddings / Tyne

C# libaries designed for making Line of Business Blazor apps more efficiently.
https://alexnoddings.github.io/Tyne/
MIT License
2 stars 0 forks source link

Change ToValue/Task to use `in` parameter rather than `ref` #149

Closed alexnoddings closed 3 months ago

alexnoddings commented 3 months ago

ref parameters block this use case:

public Task<Option<int>> MaybeGetValue() =>
    Option.Some(42).ToTask();

Results in an error since Option.Some(42) is not an assignable variable or field.

Using an in parameter still passes by ref, so we don't lose perf.