@salsita/react-entities
v1.0.0
Published
## Install
Downloads
3
Readme
react-entities
Install
Install this package with npm
npm i @salsita/react-entities
or yarn
yarn add @salsita/react-entities
API
Modules
Functions
EntitiesActions
EntitiesActions.repositoryHasChanged(repository) ⇒ Action
Modifies entity repository
Kind: static method of EntitiesActions
| Param | Type | Description | | --- | --- | --- | | repository | Partial.<EntitiesState> | Entities that will be merged into the entity repository |
entitiesReducer(state, action) ⇒ EntitiesState
The reducer of the entities module
Kind: global function
| Param | Type | Description | | --- | --- | --- | | state | EntitiesState | The state of the entities module | | action | Action | A redux action |
normalizeAndStore(data, schema) ⇒ String | Number | Array
Normalize and store data into the entity repository
Normalizes data according to the schema and stores the result into the entity repository.
Kind: global function
Returns: String | Number | Array - Returns either ID or list of IDs of normalized data
| Param | Type | Description | | --- | --- | --- | | data | Object | Array | Entity or list of entities | | schema | Object | Array | Normalizr schema |