Store
A store that holds the state tree.
Holds an Immutable.Map and offers functions to mutate sub-states in that tree, and stores the new state.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
state: * |
Method Summary
Public Methods | ||
public |
getIn(keys: *, notSetValue: *): * |
|
public |
mutateState(keys: *, fn: *) Fetch the object at keys pass it to the function which mutates it and returns new sub state. |
|
public |
mutateStateAndReturn(keys: *, fn: *): any Fetch one part of the state, mutate it with the callback, which returns result, subState. |
Public Constructors
public constructor source
Public Members
public state: * source
Public Methods
public getIn(keys: *, notSetValue: *): * source
Params:
Name | Type | Attribute | Description |
keys | * | ||
notSetValue | * |
Return:
* |
public mutateState(keys: *, fn: *) source
Fetch the object at keys pass it to the function which mutates it and returns new sub state.
Params:
Name | Type | Attribute | Description |
keys | * | ||
fn | * |
public mutateStateAndReturn(keys: *, fn: *): any source
Fetch one part of the state, mutate it with the callback, which returns result, subState. Save the subState back into state and return the result.
Params:
Name | Type | Attribute | Description |
keys | * | ||
fn | * |
Return:
any | result |