apeman-service-toggle
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
- ApToggleService Class
Functions
ApToggleService
create(args) -> 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 |
boolean
service.getToggle(toggleName) -> Get goggle value
Param | Type | Description |
---|---|---|
toggleName | string | Name of toggle |
Promise
service.turnToggle(toggleName, flg) -> Turn toggle value
Param | Type | Description |
---|---|---|
toggleName | string | Name of toggle |
flg | boolean |
Promise
service.turnOffToggle(toggleName) -> Turn toggle to off
Param | Type | Description |
---|---|---|
toggleName | string | Name of toggle |
Promise
service.turnOnToggle(toggleName) -> Turn toggle to on
Param | Type | Description |
---|---|---|
toggleName | string | Name of toggle |
License
This software is released under the MIT License.