Unceremonious redux actions
If you use redux a bunch, you might have noticed a pattern:
- Create a new action type
- Make an action creator using the new type
- Create a new reducer which handles that type
Every redux type is handled differently, and actions never seem to share a type. If adding one means adding the other, why keep them separate at all?
This library is an experiment to see what happens.
It's on npm as
yarn add reactionablenpm install reactionable --save
Now you can import it!
// Or for the ES5 among you.const Action Reducer =
There are two factory functions,
You write action creators/reducers using
Action and combine them together into a reducer.
Action(String type, Object config)
Generates a new redux action creator, coupled with its reducer.
const updateName =
Creates a redux reducer using a collection of actions. It accepts an array of actions to watch for, or an object containing actions.
const reducer =
This repo isn't actively maintained, it's just an experiment.