1.2.1 • Published 7 years ago

apeman-service-session v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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

ParamTypeDescription
args*

ApSessionService Class

Service

new ApSessionService(store, options)

Constructor of ApSessionService class

ParamTypeDescription
storeObjectRedux store
optionsObjectOptional settings

service.getSession(fieldName) -> *

Get session value

ParamTypeDescription
fieldNamestringName of field.

service.setSession(fieldName, value) -> Promise

Set session value

ParamTypeDescription
fieldNamestringName of field.
value*Value to set

service.delSession(fieldName) -> Promise

Delete session value

ParamTypeDescription
fieldNamestringName of field.

service.syncSession(fieldName, value) -> Promise

Sync session values. Delete if no value passed.

ParamTypeDescription
fieldNamestringName of field.
value*Value to set

License

This software is released under the MIT License.

Links

1.2.1

7 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago