1.0.0 • Published 7 years ago

@salsita/react-entities v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

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

ParamTypeDescription
repositoryPartial.<EntitiesState>Entities that will be merged into the entity repository

entitiesReducer(state, action) ⇒ EntitiesState

The reducer of the entities module

Kind: global function

ParamTypeDescription
stateEntitiesStateThe state of the entities module
actionActionA 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

ParamTypeDescription
dataObject | ArrayEntity or list of entities
schemaObject | ArrayNormalizr schema