Hi, I'm a Redux maintainer.<p>There's a much better solution than what this blog describes. We've just released a new package called Redux Starter Kit [0], which is meant to provide opinionated defaults and simplify writing common Redux code patterns. It's already written in TypeScript, and works great in TS apps.<p>In particular, the `createSlice` function [1] allows you to provide reducer functions that use "mutative" update logic (thanks to using the Immer library [2] internally), and auto-generates action types and action creators based on the provided reducers. Really, there's no reason to write an action creator or action type by hand ever again. `createSlice` also makes it really easy to organize your Redux logic using the single-file-per-feature "ducks" pattern [3]<p>The "Advanced Tutorial" page [4] shows how to use RSK with TypeScript, and with our new React-Redux hooks.<p>Going forward, Redux Starter Kit is our recommended way to use Redux.<p>[0] <a href="https://redux-starter-kit.js.org/" rel="nofollow">https://redux-starter-kit.js.org/</a><p>[1] <a href="https://redux-starter-kit.js.org/api/createSlice" rel="nofollow">https://redux-starter-kit.js.org/api/createSlice</a><p>[2] <a href="https://immerjs.github.io/immer/docs/introduction" rel="nofollow">https://immerjs.github.io/immer/docs/introduction</a><p>[3] <a href="https://github.com/erikras/ducks-modular-redux" rel="nofollow">https://github.com/erikras/ducks-modular-redux</a><p>[4] <a href="https://redux-starter-kit.js.org/tutorials/advanced-tutorial" rel="nofollow">https://redux-starter-kit.js.org/tutorials/advanced-tutorial</a>
The concept of action types inferred from module types is something we use in Warhol’s code a lot. It also fits nicely with the architecture of Conceptual Components as I described in my blog post here: <a href="https://drublic.de/blog/conceptual-components/" rel="nofollow">https://drublic.de/blog/conceptual-components/</a>