redux.NET
redux.NET copied to clipboard
F# support/Doc
Hi,
I did a quick test, porting the counter example to F# : https://gist.github.com/theor/0f3cbae332da0a6cdf47
Feel free to reproduce it in the lib doc/sample repo if you want.
There's some boiler plate code at the beginning which could be in its own package, any plan for f# specific support ?
Thanks
Hi Theor,
Sorry for delay, busy week...
Your gist looks nice ! F# is a natural fit for a Redux architecture so it would be awesome to support it! But honestly, I don't have any real experience with F# so I don't think I am qualified to support it in the short term. Of course, contributions are welcome ! Feel free to make other gist or PR. I will add a link to your gist to the documentation later this week.
It's always nice to see FP alternatives to OOP in .NET !
Thanks
I am digging this.
...Although it does not compile for me. The following instead works, however:
let reducerBoilerplate (reducer:'a->'b->'a) =
let inner state (action:Redux.IAction) =
match action with
| :? FAction<_> as faction -> reducer state faction.Value
| _ -> state
new Redux.Reducer<'a>(inner)