Home Reference Source Repository

Variable

Static Public Summary
public

createBlueprint(blueprintType: String, payloadCreator: Function, metaCreator: Function): Function: *

Creates an action blueprint.

public

translateBlueprintTypesWith(translateBlueprintType: Function): blueprintTypeTranslator: *

Creates a translator that turns blueprint types into action types.

public

translateBlueprintsWith(translateBlueprintType: Function): blueprintTranslator: *

Creates a translator that turns blueprints into redux-actions FSA actionCreators

Static Public

public createBlueprint(blueprintType: String, payloadCreator: Function, metaCreator: Function): Function: * source

import {createBlueprint} from 'redux-blueprint'

Creates an action blueprint. Allows delayed assignment of action type which is useful for library designers requiring namespaced action types.

Return:

Function

An action blueprint function that accepts an action type creator function as param to return an action creator.

Example:

Create an action blueprint then translate it to get its action creator at a later time.
const createActionType = blueprintType => `SOME_REDUX_LIB_${blueprintType}`
let blueprint = createBlueprint('MOUSE_EVENT', (x, y) => ({x, y}), eventType => ({ eventType }))
let actionCreator = blueprint(createActionType)

public translateBlueprintTypesWith(translateBlueprintType: Function): blueprintTypeTranslator: * source

import {translateBlueprintTypesWith} from 'redux-blueprint'

Creates a translator that turns blueprint types into action types.

Return:

blueprintTypeTranslator

Function that accepts array or object of blueprint type values and returns action types.

public translateBlueprintsWith(translateBlueprintType: Function): blueprintTranslator: * source

import {translateBlueprintsWith} from 'redux-blueprint'

Creates a translator that turns blueprints into redux-actions FSA actionCreators

Return:

blueprintTranslator

Function that accepts array or object of blueprint values and returns redux-actions FSA actionCreators.

Example:

Creates a function that can translate an array or object literal with blueprint values to actions.
const translateBlueprintType = blueprintType => `SOME_REDUX_LIB_${blueprintType}`
const translateBlueprints = translateBlueprintsWith(translateBlueprintType)
let startBlueprint = createBlueprint('START')
let endBlueprint = createBlueprint('END')
let { startAction, endAction } = translateBlueprints({ startAction: startBlueprint, endAction: endBlueprint })
dispatch(startAction())