phryneas.de · Nov 28, 2020
Do not create union types with Redux Action Types. It's most likely an antipattern.
0Sign in to vote or save
This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
So, there is a long-standing TypeScript & Redux pattern of creating a union RootAction type that contains all your application’s action types. Sometimes, you would also create a lot of reducer-specific sub-unions. I think that this has always been a crutch - and given the options we have today, it’s most likely an antipattern. So let’s look at why it was used, where it was used and what you can…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.