apeman-service-entity
Apemna service for entity
Installation
$ npm install apeman-service-entity --save
Usage
#!/usr/bin/env node 'use strict' const ApEntityService = const createStore = const reducer = const co =
API
apeman-service-entity@2.2.1
Apemna service for entity
- Functions
- ApEntityService Class
- new ApEntityService(store, options)
- service.getEntityList(entityName)
- service.getEntityOne(entityName)
- service.getEntityResources(entityName)
- service.updateEntityResources(entityName, entities)
- service.setEntityList(entityName, entities, counts)
- service.pushEntityList(entityName, entities, counts)
- service.unshiftEntityList(entityName, entities, counts)
- service.setEntityOne(entityName, entity)
- service.clearEntityList(entityName)
- service.clearEntityOne(entityName)
- service.clearEntityResource(entityName)
- service.purgeEntity(entityName)
- service.invalidateEntityCache(entityName)
Functions
ApEntityService
create(args) -> Create the service instance
Param | Type | Description |
---|---|---|
args | * |
ApEntityService Class
Service
new ApEntityService(store, options)
Constructor of ApEntityService class
Param | Type | Description |
---|---|---|
store | Object | Redux store |
options | Object | Optional settings |
Object
service.getEntityList(entityName) -> Get entity as list
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
*
service.getEntityOne(entityName) -> Get detailed entity
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
Object
service.getEntityResources(entityName) -> Get entity resources.
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
Promise
service.updateEntityResources(entityName, entities) -> Update entity resources.
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
entities | Array.<Object>,Object | Entities to push |
Promise
service.setEntityList(entityName, entities, counts) -> Set entity list.
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
entities | Array.<Object> | Entities to push |
counts | Object | Count info |
Promise
service.pushEntityList(entityName, entities, counts) -> Push to entity list.
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
entities | Array.<Object> | Entities to push |
counts | Object | Count info |
Promise
service.unshiftEntityList(entityName, entities, counts) -> Unshift to entity list.
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
entities | Array.<Object> | Entities to unshift |
counts | Object | Count info |
Promise
service.setEntityOne(entityName, entity) -> Set entity one
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
entity | Object | Entity to set. |
Promise
service.clearEntityList(entityName) -> Clear entity list
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
Promise
service.clearEntityOne(entityName) -> Clear entity one
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
Promise
service.clearEntityResource(entityName) -> Clear entity resource
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
Promise
service.purgeEntity(entityName) -> Clear entity one
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
Promise
service.invalidateEntityCache(entityName) -> Invalidate entity cache
Param | Type | Description |
---|---|---|
entityName | string | Name of entity. |
License
This software is released under the MIT License.