Skip to content

Instantly share code, notes, and snippets.

@willmendesneto
Created July 13, 2021 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willmendesneto/a2d08bc4ba22387955f9fb52d7fe8186 to your computer and use it in GitHub Desktop.
Save willmendesneto/a2d08bc4ba22387955f9fb52d7fe8186 to your computer and use it in GitHub Desktop.
Using multiple versions of the same package in a project: index.js
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