3 ms·
When you get a chance, please check out our new Redux Starter Kit package. It includes utilities to simplify several common Redux use cases, including store set
by acemarke 7y ago
When you get a chance, please check out our new Redux Starter Kit package. It includes utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once:
https://redux-starter-kit.js.org https://redux-starter-kit.js.org
It's also written in TypeScript itself, so it works well for TS usage. It doesn't do as much strict magical inference as something like `typesafe-actions`, but it should be very usable.
I recently wrote a small example "Github issues" app that's written in TS and uses Redux Starter Kit and our new React-Redux hooks API, if you'd like to see how the code looks:
https://github.com/markerikson/rsk-github-issues-experiment https://github.com/markerikson/rsk-github-issues-experiment
In particular, here's an example of RSK's `createSlice()` API in action, with TS and some thunks:
https://github.com/markerikson/rsk-github-issues-experiment/blob/67691649ce5815158e7f86eefac40df221fd1817/src/features/IssuesList/issues.ts https://github.com/markerikson/rsk-github-issues-experiment/...
- ht85 7y agoSmall nitpick: loading state should be a counter incremented / decremented on each request / response, not a boolean. This looks very nice though, avoids almost all the repetitions you usually have to write when setting up reducers and actions!