off()
create.off
create(actionType).off
Appropriate leaf state: boolean
Returns an (action) object that the reduxLeaves reducer uses to update the leaf's state to false
.
Returns
action
(object): an object to dispatch to the store
Example
import { createStore } from 'redux'
import reduxLeaves from 'reduxLeaves'
const initialState = {
foo: true,
bar: true
}
const [reducer, actions] = reduxLeaves(initialState)
const store = createStore(reducer)
create.off
Calling const turnOffFoo = actions.foo.create.off
store.dispatch(turnOffFoo())
console.log(store.getState().foo) // false
create(actionType).off
Calling const turnOffBar = actions.bar.create('TURN_OFF_BAR').off
store.dispatch(turnOffBar())
console.log(store.getState().bar) // false