apeman-service-entry
v2.0.0
Published
Service for form entries.
Downloads
3
Readme
apeman-service-entry
Service for form entries.
Installation
$ npm install apeman-service-entry --save
Usage
#!/usr/bin/env node
'use strict'
const { ApEntryService } = require('apeman-service-entry')
const { createStore } = require('redux')
const { reducer } = require('apeman-service-base')
const co = require('co')
co(function * () {
let store = createStore(reducer)
let service = new ApEntryService(store)
}).catch((err) => console.error(err))
API
[email protected]
Service for form entries.
- Functions
- ApEntryService Class
Functions
create(args) -> ApEntryService
Create the service instance
| Param | Type | Description | | ----- | --- | -------- | | args | * | |
ApEntryService Class
Service for entry
new ApEntryService(store, options)
Constructor of ApEntryService class
| Param | Type | Description | | ----- | --- | -------- | | store | Object | Redux store | | options | Object | Optional settings |
service.getEntry(entryName) -> Object
Get entry values
| Param | Type | Description | | ----- | --- | -------- | | entryName | string | Name of entry. |
service.getEntryError(entryName) -> Object
Get entry errors
| Param | Type | Description | | ----- | --- | -------- | | entryName | string | Name of entry. |
service.updateEntry(entryName, values) -> Promise
Update an entry.
| Param | Type | Description | | ----- | --- | -------- | | entryName | string | Name of entry. | | values | Object | Values to set |
service.clearEntry(entryName) -> Promise
Clear an entry.
| Param | Type | Description | | ----- | --- | -------- | | entryName | string | Name of entry. |
service.clearEntryError(entryName) -> Promise
Clear errors for an entry.
| Param | Type | Description | | ----- | --- | -------- | | entryName | string | Name of entry. |
service.catchEntryError(entryName, err) -> Promise
Catch entry error
| Param | Type | Description | | ----- | --- | -------- | | entryName | string | Name of entry | | err | Object | Caught error |
License
This software is released under the MIT License.