This PR introduces a dependency on the redux-starter-kit, which includes a handful of helper APIs to reducer boilerplate. To begin with, I'm going to refactor all of our actions and action creators to use the createAction method, which allows us to have a single object that represents both the action name and creator.
Right now, this PR only refactors a single action, in order to illustrate the change. Assuming folks are cool with this change, I'll update the rest, which should dramatically simplify actions.ts.
In addition to this change, redux-starter-kit also provides helpers for simplifying your reducers, which I'll do in a follow-up PR.
This PR introduces a dependency on the
redux-starter-kit
, which includes a handful of helper APIs to reducer boilerplate. To begin with, I'm going to refactor all of our actions and action creators to use thecreateAction
method, which allows us to have a single object that represents both the action name and creator.Right now, this PR only refactors a single action, in order to illustrate the change. Assuming folks are cool with this change, I'll update the rest, which should dramatically simplify
actions.ts
.In addition to this change,
redux-starter-kit
also provides helpers for simplifying your reducers, which I'll do in a follow-up PR.