mrpmorris / Fluxor

Fluxor is a zero boilerplate Flux/Redux library for Microsoft .NET and Blazor.
MIT License
1.22k stars 139 forks source link

Support F# records as FeatureState #429

Closed mrakgr closed 1 year ago

mrakgr commented 1 year ago

A parameterless constructor is required on state for determining the initial state, and can be private or public.

I meant to define the reducers on the F# side, and had intended to define feature state as records, but then I read this line. Unfortunately, it is not possible to define a constructor on an F# record. Is there a way to get around this restriction?

mrakgr commented 1 year ago

Also, wouldn't the same issue apply to C# records?

mrpmorris commented 1 year ago

FeatureState attribute lets you specify the name of a static method instead, does that help?

mrakgr commented 1 year ago

Yes, thank you.