3.0.1 • Published 4 years ago

thesmo-redux-dispatch v3.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

npm GitHub GitHub last commit npm GitHub top language code style: prettier

About

This package provides you using Redux store as tree. It gives you possibility of having updates and obtaining values by node path. You can apply changes to one node, multiple nodes or whole state at once. Changes can be applied via calculating field.

Functions

getReducer

Returns reducer for Redux store which can be used with following actions

type Args = {
    defaultState?: object;
};

type Signature = ({ defaultState = {} }: Args) => Reducer

getUpdateMultipleNodesAction

Returns action for multiple nodes update via calculating fields

type UpdateNodePayload = {
    nodePath: string;
    calcField: SafeCF<any, any>;
};

type UpdateMultipleNodesPayload = { 
    updates: UpdateNodePayload[] 
};

type Args = UpdateMultipleNodesPayload;

type Signature = ({ updates }: Args) 
    => Action<string> & UpdateMultipleNodesPayload

getUpdateNodeAction

Returns action for single node update via calculating field

type UpdateNodePayload = {
    nodePath: string;
    calcField: SafeCF<any, any>;
};

type Args = UpdateNodePayload;

type Signature = ({
    calcField,
    nodePath
}: Args) => Action<string> & UpdateNodePayload

getUpdateWholeStateAction

Returns action for updating whole store via calculating field

type UpdateWholeStatePayload = {
    calcField: SafeCF<any, any>;
};

type Args = UpdateWholeStatePayload;

type Signature = ({ 
    calcField
}: Args) => Action<string> & UpdateWholeStatePayload
3.0.1

4 years ago

3.0.0

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago