Function
Static Public Summary | ||
public |
addError(state: *, action: *) adds an error to the |
|
public |
Given a prop, set the async start flag to false |
|
public |
asyncStart(prop: String): Reduction Given a prop, set the async start flag to true |
|
public |
byType(init: State, typeObj: ReductionMap): Reducer Create a reducer with an initial state, and a reduction map (from type to reduction) |
|
public |
clearErrors(state: *) resets the |
|
public |
compose(reductions: ...Reduction): Reduction given multiple reductions, combine them into a single reduction |
|
public |
Given a type, return a function that will pass it's argument as an error. |
|
public |
merge(state: State, action: Action): Reduction Given a state and an action, merge the action's payload into the state. |
|
public |
Don't pass any information, just pass the type to the reducer. |
|
public |
given a prop, set the action's payload prop at state.prop |
|
public |
Given a type, create a function that accepts a payload and passes that with the given type. |
|
public |
given a type and a promise creator, return an action creator that will accept the arguments to the promise, and on resolve, return a action.payload funciton. |
Static Public
public addError(state: *, action: *) source
import {addError} from 'reducker/src/reduce.js'
adds an error to the errors
list of a piece of state
Params:
Name | Type | Attribute | Description |
state | * | ||
action | * |
public asyncEnd(prop: String): Reduction source
import {asyncEnd} from 'reducker/src/reduce.js'
Given a prop, set the async start flag to false
Params:
Name | Type | Attribute | Description |
prop | String |
Return:
Reduction |
public asyncStart(prop: String): Reduction source
import {asyncStart} from 'reducker/src/reduce.js'
Given a prop, set the async start flag to true
Params:
Name | Type | Attribute | Description |
prop | String |
Return:
Reduction |
public byType(init: State, typeObj: ReductionMap): Reducer source
import {byType} from 'reducker/src/reduce.js'
Create a reducer with an initial state, and a reduction map (from type to reduction)
Params:
Name | Type | Attribute | Description |
init | State | ||
typeObj | ReductionMap |
Return:
Reducer | [description] |
public clearErrors(state: *) source
import {clearErrors} from 'reducker/src/reduce.js'
resets the errors
object back to the empty list.
Params:
Name | Type | Attribute | Description |
state | * |
public compose(reductions: ...Reduction): Reduction source
import {compose} from 'reducker/src/reduce.js'
given multiple reductions, combine them into a single reduction
Params:
Name | Type | Attribute | Description |
reductions | ...Reduction |
Return:
Reduction |
public error(type: String): ActionCreator source
import {error} from 'reducker/src/action.js'
Given a type, return a function that will pass it's argument as an error.
Params:
Name | Type | Attribute | Description |
type | String |
Return:
ActionCreator |
public merge(state: State, action: Action): Reduction source
import {merge} from 'reducker/src/reduce.js'
Given a state and an action, merge the action's payload into the state.
Params:
Name | Type | Attribute | Description |
state | State | ||
action | Action |
Return:
Reduction |
public noop(type: String): ActionCreator source
import {noop} from 'reducker/src/action.js'
Don't pass any information, just pass the type to the reducer.
Params:
Name | Type | Attribute | Description |
type | String |
Return:
ActionCreator |
public overwrite(prop: String): Reduction source
import {overwrite} from 'reducker/src/reduce.js'
given a prop, set the action's payload prop at state.prop
Params:
Name | Type | Attribute | Description |
prop | String |
Return:
Reduction |
public payload(type: String): ActionCreator source
import {payload} from 'reducker/src/action.js'
Given a type, create a function that accepts a payload and passes that with the given type.
Params:
Name | Type | Attribute | Description |
type | String |
Return:
ActionCreator |
public thunk(type: String, prom: Promise): ActionCreator source
import {thunk} from 'reducker/src/action.js'
given a type and a promise creator, return an action creator that will accept the arguments to the promise, and on resolve, return a action.payload funciton. On reject return an action.error.
Return:
ActionCreator |