apeman-service-session

1.2.1 • Public • Published

apeman-service-session

Build Status npm Version JS Standard

Apeman service for sessions.

Installation

$ npm install apeman-service-session --save

Usage

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

API

apeman-service-session@1.2.1

Apeman service for sessions.

Functions

create(args) -> ApSessionService

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.

service.setSession(fieldName, value) -> Promise

Set session value

Param Type Description
fieldName string Name of field.
value * Value to set

service.delSession(fieldName) -> Promise

Delete session value

Param Type Description
fieldName string Name of field.

service.syncSession(fieldName, value) -> Promise

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.

Links

Readme

Keywords

Package Sidebar

Install

npm i apeman-service-session

Weekly Downloads

1

Version

1.2.1

License

MIT

Last publish

Collaborators

  • okunishinishi