apeman-service-session

Apeman service for sessions.

Usage no npm install needed!

<script type="module">
  import apemanServiceSession from 'https://cdn.skypack.dev/apeman-service-session';
</script>

README

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