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

Share example project on README? #50

Open
bhgsbatista opened this issue Apr 10, 2020 · 0 comments
Open

Share example project on README? #50

bhgsbatista opened this issue Apr 10, 2020 · 0 comments

Comments

@bhgsbatista
Copy link

bhgsbatista commented Apr 10, 2020

Using ImmerReducer with TypeScript is such a pleasant experience, everything is type-safe, and with some extra work you can have the compiler enforce immutability on the state outside of producers.

I built a little React based calendar app that uses two ImmerReducers for state management. This example provides a useful foundation to build a more complex app made up of several small reducers:

https://github.com/gamedevsam/calendar-appointments

The magic sauce are these files in the Redux directory:

And of course the connector components:

One other noteworthy thing is the immutable generic type, which allows TypeScript to enforce immutability at compile time: src/types/immutable.ts


image

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

1 participant