Home Reference Source

Function

Static Public Summary
public

addError(state: *, action: *)

adds an error to the errors list of a piece of state

public

asyncEnd(prop: String): Reduction

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 errors object back to the empty list.

public

compose(reductions: ...Reduction): Reduction

given multiple reductions, combine them into a single reduction

public

error(type: String): ActionCreator

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

noop(type: String): ActionCreator

Don't pass any information, just pass the type to the reducer.

public

overwrite(prop: String): Reduction

given a prop, set the action's payload prop at state.prop

public

payload(type: String): ActionCreator

Given a type, create a function that accepts a payload and passes that with the given type.

public

thunk(type: String, prom: Promise): ActionCreator

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
state *

public compose(reductions: ...Reduction): Reduction source

import {compose} from 'reducker/src/reduce.js'

given multiple reductions, combine them into a single reduction

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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.

Params:

NameTypeAttributeDescription
type String
prom Promise

Return:

ActionCreator