off()

create.off create(actionType).off Appropriate leaf state: boolean

Returns a Riduce-standard action to update the leaf's state to false.

Returns

action (object): a Riduce-standard action

Example

import { createStore } from 'redux'
import riduce from 'riduce'

const initialState = {
  foo: true,
  bar: true
}

const [reducer, actions] = riduce(initialState)
const store = createStore(reducer)

Calling create.off

const turnOffFoo = actions.foo.create.off
store.dispatch(turnOffFoo())
console.log(store.getState().foo) // false

Calling create(actionType).off

const turnOffBar = actions.bar.create('TURN_OFF_BAR').off
store.dispatch(turnOffBar())
console.log(store.getState().bar) // false