suite-flipper-js
Advanced tools
Comparing version 1.0.2 to 1.0.4
{ | ||
"name": "suite-flipper-js", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"description": "Flipper Class", | ||
"main": "lib/index.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "mocha test" | ||
"test": "mocha test", | ||
"build": "rm -rf dist/* && babel lib --ignore __tests__ --out-dir dist", | ||
"prepublish": "npm test && npm run build" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
"babelify" | ||
] | ||
}, | ||
"repository": { | ||
@@ -24,2 +21,3 @@ "type": "git", | ||
"devDependencies": { | ||
"babel": "^5.8.23", | ||
"chai": "^3.2.0", | ||
@@ -26,0 +24,0 @@ "lodash": "^3.10.1", |
@@ -6,30 +6,40 @@ # suite-flipper-js | ||
npm install --save suite-flipper-js | ||
```bash | ||
npm install --save suite-flipper-js | ||
``` | ||
Usage | ||
--------- | ||
var flipper = Flipper.create(['bi', 'dummy', 'dummy2']); | ||
flipper.isOn('bi'); //true | ||
flipper.isOn('notInTheList'); //false | ||
flipper.isOff('bi'); //false | ||
flipper.isOff('notInTheList'); //true | ||
Usage from api response | ||
```javascript | ||
var flipper = Flipper.create(['bi', 'dummy', 'dummy2']); | ||
flipper.isOn('bi'); //true | ||
flipper.isOn('notInTheList'); //false | ||
flipper.isOff('bi'); //false | ||
flipper.isOff('notInTheList'); //true | ||
``` | ||
Usage from service api response | ||
--------- | ||
var flipper = Flipper.createForApiResponse([ | ||
{ id: 'bi', isOn: true }, | ||
{ id: 'dummy', isOn: true }, | ||
{ id: 'dummy2', isOn: false } | ||
]); | ||
flipper.isOn('bi'); //true | ||
flipper.isOn('dummy2'); //false | ||
flipper.isOn('notInTheList'); //false | ||
flipper.isOff('bi'); //false | ||
flipper.isOff('dummy2'); //true | ||
flipper.isOff('notInTheList'); //true | ||
```javascript | ||
var flipper = Flipper.createForApiResponse([ | ||
{ id: 'bi', isOn: true }, | ||
{ id: 'dummy', isOn: true }, | ||
{ id: 'dummy2', isOn: false } | ||
]); | ||
flipper.isOn('bi'); //true | ||
flipper.isOn('dummy2'); //false | ||
flipper.isOn('notInTheList'); //false | ||
flipper.isOff('bi'); //false | ||
flipper.isOff('dummy2'); //true | ||
flipper.isOff('notInTheList'); //true | ||
``` | ||
Usage in Angular Js | ||
--------- | ||
[There is a wrapper for this class to use with angularJS](https://github.com/emartech/angular-suite-flipper) | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29958
13
45
6
37