Created
July 13, 2021 03:11
-
-
Save willmendesneto/a2d08bc4ba22387955f9fb52d7fe8186 to your computer and use it in GitHub Desktop.
Using multiple versions of the same package in a project: index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { isOn, set } = require('feature-toggle-service'); | |
const { isOn: isOnNext, set: setNext } = require('feature-toggle-service-next'); | |
const defaultConfig = { enableFirstSection: true }; | |
set(defaultConfig); | |
setNext(defaultConfig); | |
// ❌ Old version: does NOT have a `debug` option | |
console.log(isOn('enableFirstSection')); | |
// ✅ Latest version: does have a `debug` option available | |
console.log(isOnNext('enableFirstSection', true)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment