redux.NET icon indicating copy to clipboard operation
redux.NET copied to clipboard

F# support/Doc

Open theor opened this issue 9 years ago • 3 comments

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

theor avatar Nov 29 '15 20:11 theor

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

GuillaumeSalles avatar Dec 03 '15 05:12 GuillaumeSalles

I am digging this.

zsszatmari avatar Feb 01 '16 14:02 zsszatmari

...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)

zsszatmari avatar Feb 01 '16 15:02 zsszatmari