mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
19 lines
421 B
TypeScript
19 lines
421 B
TypeScript
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());
|