@vjustov/feature-toggles
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Feature Flags ts

A simple package that implements feature toggles for JS and React using Typescript.

Using the Feature Flags

in src/config/FeatureFlags.tsx you will see that there is an object with all the flags, you just add a new flag to the AvailableFlags and to the flags object. Like so:

export enum AvailableFlags {
  resubmitButton = 'resubmitButton'
}
// ...
const flags = {
  resubmitButton: true
};

Then you are free to use the Flag Component passing it a name to flag that is protecting the childrens

<Flag name={AvailableFlags.resubmitButton}>
  <button>Resubmit</button>
</Flag>

Package Sidebar

Install

npm i @vjustov/feature-toggles

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

3.98 kB

Total Files

4

Last publish

Collaborators

  • vjustov