apeman-service-entity

3.0.0 • Public • Published

apeman-service-entity

Build Status npm Version JS Standard

Apemna service for entity

Installation

$ npm install apeman-service-entity --save

Usage

#!/usr/bin/env node
 
'use strict'
 
const { ApEntityService } = require('apeman-service-entity')
const { createStore } = require('redux')
const { reducer } = require('apeman-service-base')
const co = require('co')
 
co(function * () {
  let store = createStore(reducer)
  let service = new ApEntityService(store)
 
 
}).catch((err) => console.error(err))

API

apeman-service-entity@2.2.1

Apemna service for entity

Functions

create(args) -> ApEntityService

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

service.getEntityList(entityName) -> Object

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.

service.getEntityResources(entityName) -> Object

Get entity resources.

Param Type Description
entityName string Name of entity.

service.updateEntityResources(entityName, entities) -> Promise

Update entity resources.

Param Type Description
entityName string Name of entity.
entities Array.<Object>,Object Entities to push

service.setEntityList(entityName, entities, counts) -> Promise

Set entity list.

Param Type Description
entityName string Name of entity.
entities Array.<Object> Entities to push
counts Object Count info

service.pushEntityList(entityName, entities, counts) -> Promise

Push to entity list.

Param Type Description
entityName string Name of entity.
entities Array.<Object> Entities to push
counts Object Count info

service.unshiftEntityList(entityName, entities, counts) -> Promise

Unshift to entity list.

Param Type Description
entityName string Name of entity.
entities Array.<Object> Entities to unshift
counts Object Count info

service.setEntityOne(entityName, entity) -> Promise

Set entity one

Param Type Description
entityName string Name of entity.
entity Object Entity to set.

service.clearEntityList(entityName) -> Promise

Clear entity list

Param Type Description
entityName string Name of entity.

service.clearEntityOne(entityName) -> Promise

Clear entity one

Param Type Description
entityName string Name of entity.

service.clearEntityResource(entityName) -> Promise

Clear entity resource

Param Type Description
entityName string Name of entity.

service.purgeEntity(entityName) -> Promise

Clear entity one

Param Type Description
entityName string Name of entity.

service.invalidateEntityCache(entityName) -> Promise

Invalidate entity cache

Param Type Description
entityName string Name of entity.

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i apeman-service-entity

Weekly Downloads

3

Version

3.0.0

License

MIT

Last publish

Collaborators

  • okunishinishi