File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ import qs from "qs";
22
33import { isRunningInBrowser } from "@/utils/is-running-in-browser" ;
44
5- import FlagStore , { FlagName , FlagValue } from "./store" ;
5+ import FlagStore from "./store" ;
6+ import { FlagName , FlagValue } from "./types" ;
67
78const FLAG_PREFIX = "flag__" ;
89
Original file line number Diff line number Diff line change 1- import { FlagName , FlagValue } from "./store " ;
1+ import { FlagName , FlagValue } from "./types " ;
22
33export const prefix = "flag__" ;
44export const getKey = ( name : FlagName ) => prefix + name ;
Original file line number Diff line number Diff line change 11import mitt , { Emitter } from "mitt" ;
22
33import lsAdapter from "./ls-adapter" ;
4-
5- export type FlagValue = any ;
6-
7- export type FlagName =
8- /** Whether we can search by termsets */
9- | "search.termsets"
10- /** Whether we can add dataset from shared dimensions */
11- | "configurator.add-dataset.shared"
12- /** Whether we can add a new dataset */
13- | "configurator.add-dataset.new"
14- /** Whether we can use the free canvas dashboard layout */
15- | "layouter.dashboard.free-canvas"
16- /** Whether we can use shared filters on dashboard layout */
17- | "layouter.dashboard.shared-filters" ;
4+ import { FlagName , FlagValue } from "./types" ;
185
196type Events = { change : string } ;
207/**
Original file line number Diff line number Diff line change 1+ export type FlagValue = any ;
2+
3+ export type FlagName =
4+ /** Whether we can search by termsets */
5+ | "search.termsets"
6+ /** Whether we can add dataset from shared dimensions */
7+ | "configurator.add-dataset.shared"
8+ /** Whether we can add a new dataset */
9+ | "configurator.add-dataset.new"
10+ /** Whether we can use the free canvas dashboard layout */
11+ | "layouter.dashboard.free-canvas"
12+ /** Whether we can use shared filters on dashboard layout */
13+ | "layouter.dashboard.shared-filters" ;
Original file line number Diff line number Diff line change 11import { useEffect , useState } from "react" ;
22
3- import { FlagName } from "@/flags/store" ;
4-
53import { flag } from "./flag" ;
4+ import { FlagName } from "./types" ;
65
76export default function useFlag ( name : FlagName ) {
87 const [ flagValue , setFlag ] = useState ( ( ) => flag ( name ) ) ;
You can’t perform that action at this time.
0 commit comments