✨ Magical ✨ Action Types (for Flux, Redux, etc)
But why tho?
This is annoying.
const INCREMENT = 'app/counter/INCREMENT'const DECREMENT = 'app/counter/DECREMENT'
This is weird.
const types =
But this is ✨ magical ✨
const INCREMENT DECREMENT =
Usage
npm install magic-action-types
Use object destructuring to simplify your action type definitions.
const INCREMENT DECREMENT = // INCREMENT === "INCREMENT"// DECREMENT === "DECREMENT"
Pass a namespace to the types function.
const INCREMENT DECREMENT = // INCREMENT === "app/counter/INCREMENT"// DECREMENT === "app/counter/DECREMENT"
Go ahead, save your namespace too.
const counterTypes = const INCREMENT DECREMENT = counterTypes// INCREMENT === "app/counter/INCREMENT"// DECREMENT === "app/counter/DECREMENT"