Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.forEach((v, index) => {
const instance = new unleash.Unleash({
appName: `demo-app-${index % 5}`,
instanceId: `index-${index}`,
url: 'http://localhost:4242/',
refreshIntervall: 4000,
metricsInterval: 10000,
strategies: [
new unleash.Strategy('extra', true),
],
});
instance.on('ready', () => {
console.log('connected to unleash', index);
setInterval(() => {
instance.isEnabled('toggle-1', null, Boolean(Math.round(Math.random() * 2)));
}, Math.round(Math.random() * 1000));
setInterval(() => {
instance.isEnabled('toggle-2', null, Boolean(Math.round(Math.random() * 2)));
}, 1500);
setInterval(() => {
instance.isEnabled('toggle-3', null, Boolean(Math.round(Math.random() * 2)));
}, 1300);
.forEach((v, index) => {
const instance = new unleash.Unleash({
appName: `demo-app-${index % 5}`,
instanceId: `index-${index}`,
url: 'http://localhost:4242/',
refreshIntervall: 4000,
metricsInterval: 10000,
strategies: [
new unleash.Strategy('extra', true),
],
});
instance.on('ready', () => {
console.log('connected to unleash', index);
setInterval(() => {
instance.isEnabled('toggle-1', null, Boolean(Math.round(Math.random() * 2)));
function init(options) {
return initialize(Object.assign(options, {
url: 'https://weco-feature-flags.herokuapp.com/api/',
refreshInterval: 60 * 1000,
strategies: [new ActiveForUserInCohort(), new UserEnabled()]
}));
}