suite-flipper-js
Install
npm install --save suite-flipper-js
Usage
var flipper = Flipper.create(['bi', 'dummy', 'dummy2']);
flipper.isOn('bi');
flipper.isOn('notInTheList');
flipper.isOff('bi');
flipper.isOff('notInTheList');
Usage from service api response
var flipper = Flipper.createForApiResponse([
{ id: 'bi', isOn: true },
{ id: 'dummy', isOn: true },
{ id: 'dummy2', isOn: false }
]);
flipper.isOn('bi');
flipper.isOn('dummy2');
flipper.isOn('notInTheList');
flipper.isOff('bi');
flipper.isOff('dummy2');
flipper.isOff('notInTheList');
Usage in Angular Js
There is a wrapper for this class to use with angularJS