mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 18:09:09 +00:00
chore: move src/common/utils to @roleypoly/misc-utils
This commit is contained in:
parent
a374030438
commit
65a8760e86
36 changed files with 38 additions and 465 deletions
19
packages/misc-utils/featureFlags/react/FeatureFlags.tsx
Normal file
19
packages/misc-utils/featureFlags/react/FeatureFlags.tsx
Normal file
|
@ -0,0 +1,19 @@
|
|||
import * as React from 'react';
|
||||
|
||||
export enum FeatureFlag {
|
||||
AllowListsBlockLists = 'AllowListsBlockLists',
|
||||
}
|
||||
|
||||
export class FeatureFlagProvider {
|
||||
activeFlags: FeatureFlag[] = [];
|
||||
|
||||
constructor(flags: FeatureFlag[] = []) {
|
||||
this.activeFlags = flags;
|
||||
}
|
||||
|
||||
has(flag: FeatureFlag) {
|
||||
return this.activeFlags.includes(flag);
|
||||
}
|
||||
}
|
||||
|
||||
export const FeatureFlagsContext = React.createContext(new FeatureFlagProvider());
|
Loading…
Add table
Add a link
Reference in a new issue