apeman-service-session
Apeman service for sessions.
Installation
$ npm install apeman-service-session --save
Usage
#!/usr/bin/env node 'use strict' const ApSessionService = const createStore = const reducer = const co =
API
apeman-service-session@1.2.1
Apeman service for sessions.
- Functions
- ApSessionService Class
Functions
ApSessionService
create(args) -> Create the service instance
Param | Type | Description |
---|---|---|
args | * |
ApSessionService Class
Service
new ApSessionService(store, options)
Constructor of ApSessionService class
Param | Type | Description |
---|---|---|
store | Object | Redux store |
options | Object | Optional settings |
*
service.getSession(fieldName) -> Get session value
Param | Type | Description |
---|---|---|
fieldName | string | Name of field. |
Promise
service.setSession(fieldName, value) -> Set session value
Param | Type | Description |
---|---|---|
fieldName | string | Name of field. |
value | * | Value to set |
Promise
service.delSession(fieldName) -> Delete session value
Param | Type | Description |
---|---|---|
fieldName | string | Name of field. |
Promise
service.syncSession(fieldName, value) -> Sync session values. Delete if no value passed.
Param | Type | Description |
---|---|---|
fieldName | string | Name of field. |
value | * | Value to set |
License
This software is released under the MIT License.