How to use the cozy-flags.store function in cozy-flags

To help you get started, we’ve selected a few cozy-flags examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy.github.io / en / cozy-banks / src / utils / flag.js View on Github external
}

const isDemoCozy = () => {
  const location = window.location.href
  return some(demoFqdns.map(fqdn => locationMatchesFqdn(location, fqdn)))
}

if (isDemoCozy()) {
  flag('demo', true)
}

Figure.defaultProps = Object.assign({}, Figure.defaultProps, {
  blurred: flag('amount_blur') ? true : false
})

flag.store.on('change', function(flagName) {
  if (flagName == 'amount_blur') {
    Figure.defaultProps.blurred = flag('amount_blur')
  }
})

window.flag = flag

cozy-flags

Flag library used in Cozy

MIT
Latest version published 5 months ago

Package Health Score

66 / 100
Full package analysis