Service for toggle.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ci
doc
example
lib
test
.LICENSE.bud
.README.md.bud
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
jsdoc.json
package.json

README.md

apeman-service-toggle

Build Status npm Version JS Standard

Service for toggle.

Installation

$ npm install apeman-service-toggle --save

Usage

#!/usr/bin/env node

'use strict'

const { ApToggleService } = require('apeman-service-toggle')
const { createStore } = require('redux')

{
  let store = createStore({ /* ... */ })
  let service = new ApToggleService(store)
}

API

apeman-service-toggle@2.0.0

Service for toggle.

Functions

create(args) -> ApToggleService

Create the service instance

Param Type Description
args *

ApToggleService Class

Service

new ApToggleService(store, options)

Constructor of ApToggleService class

Param Type Description
store Object Redux store
options Object Optional settings

service.getToggle(toggleName) -> boolean

Get goggle value

Param Type Description
toggleName string Name of toggle

service.turnToggle(toggleName, flg) -> Promise

Turn toggle value

Param Type Description
toggleName string Name of toggle
flg boolean

service.turnOffToggle(toggleName) -> Promise

Turn toggle to off

Param Type Description
toggleName string Name of toggle

service.turnOnToggle(toggleName) -> Promise

Turn toggle to on

Param Type Description
toggleName string Name of toggle

License

This software is released under the MIT License.

Links