Open Source UI Toolkit - Feature Toggles
npm install @blaze/togglesBlaze is a framework-free open source UI toolkit. It provides great structure for building websites quickly with a scalable and maintainable foundation.
https://www.blazeui.com

Add the following to your .
``html`
The x.x.x is the specific version of the library, you should use specifc versions to prevent against breaking changes.
Next add some feature toggle config, e.g.
`js`
FeatureToggles.set({
welcomeMessage: true,
loginPage: {
rememberMe: 'alpha',
},
});
You can call FeatureToggles.set({...}) at anytime to update config. Everytime FeatureToggles.set is called it raises a featureToggleChange event that you can hook into.
set also merges the config with the already set config.
Config _values_ can be either booleans, strings or functions.
Promises are supported.
e.g. the below to toggle the feature after 2 seconds once the promise has resolved.
`js`
FeatureToggles.set({
welcomeMessage: true,
loginPage: {
rememberMe: () => new Promise((resolve) => setTimeout(() => resolve('alpha'), 2000)),
},
});
`html
content will be VISIBLE
content will be VISIBLE
content will be HIDDEN
`
| Setting | Description |
| :-------: | :--------------------------------------------------------------------- |
| feature | Feature config item, supports dot notation |variant
| | The value the toggle must be to turn on this feature (default: true`) |