NeaSTDL / redux-crud-essentials

A specialized functional factory to construct elemental CRUD operation's facilities for Redux implementations.
MIT License
0 stars 0 forks source link

Allow one or multiple entities to be passed onto the action creators. #2

Closed NeaSTDL closed 5 years ago

NeaSTDL commented 5 years ago

As per suggested, the action creator functions will be modified allow variable amounts of entity objects to be used onto them.

Example:

import { actionCreatorsFor } from ''./lib/actionCreators';
const forEntity = actionCreatorsFor('fruits');

// Single entity via an object
forEntity.fruits.create({id: 1, name: 'banana'}); 
// Multiple entities via an array of objects
forEntity.fruits.create([
  {id: 1, name: 'pear', color: 'green'},
  {id: 2, name: 'apple', color: 'red'},
]);
NeaSTDL commented 5 years ago

Issue addressed on commit 8181130266f7b056a0ce307f97bd6028134e1a0f.