https://github.com/l2silver/erschema-actions
https://github.com/l2silver/erschema-actions
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/l2silver/erschema-actions
- Owner: l2silver
- Created: 2017-03-12T20:18:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-15T20:27:24.000Z (over 8 years ago)
- Last Synced: 2024-12-29T18:34:42.317Z (over 1 year ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# erschema-actions
This is a utility action class to be used alongside the erschema-redux-immutable library
```
class erschemaActions {
entities: {
create: (ent: Object) => any,
update: (ent: Object) => any,
remove: (id: $$id) => any,
get: (ent: Object) => any,
index: (ents: Object[]) => any,
getRelated: (id: $$id, relationshipName: string, ents: Object[]) => any,
getAdditionalEntityProperties: (id: $$id, entityName: string, entity: Object) => any,
concatRelated: (id: $$id, relationshipName: string, ents: Object[]) => any,
}
}
```
It uses the standard erschema-redux-immutable entity actions, with the exception of get and index. get and index are variations of the normalize action that comes with erschema-redux-immutable, which means they take a nested object(s) and creates a series of entity index and relationship index actions to pass that information into the redux store. To keep these operations performant, the actions are wrapped in the redux-batched-actions library, so that they appear as a single transaction.