Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F# support/Doc #23

Open
theor opened this issue Nov 29, 2015 · 3 comments
Open

F# support/Doc #23

theor opened this issue Nov 29, 2015 · 3 comments

Comments

@theor
Copy link

theor commented Nov 29, 2015

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

@GuillaumeSalles
Copy link
Owner

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

@zsszatmari
Copy link

I am digging this.

@zsszatmari
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants