fix: feature flag offline mode
This commit is contained in:
@@ -2,7 +2,15 @@
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
- set provider
|
- Set token at environment variable
|
||||||
|
- The key can be obtained from the [Feature Flag Portal](https://portal.featureflag.co/account-settings/projects)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# .env.local
|
||||||
|
AFFINE_FEATURE_FLAG_TOKEN=XXXXXXX
|
||||||
|
```
|
||||||
|
|
||||||
|
- Set provider
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { FeatureFlagsProvider } from '@toeverything/datasource/feature-flags';
|
import { FeatureFlagsProvider } from '@toeverything/datasource/feature-flags';
|
||||||
@@ -42,7 +50,8 @@ const App = () => {
|
|||||||
|
|
||||||
**When entering development mode feature flag will NOT be updated in real time**
|
**When entering development mode feature flag will NOT be updated in real time**
|
||||||
|
|
||||||
- `activateFfcDevMode()` play with feature flags locally
|
- `activateFfcDevMode(PASSWORD)` play with feature flags locally
|
||||||
|
- The `devModePassword` can be obtained from `src/config.ts`
|
||||||
- `quitFfcDevMode()` quit dev mode
|
- `quitFfcDevMode()` quit dev mode
|
||||||
|
|
||||||
## Running unit tests
|
## Running unit tests
|
||||||
|
|||||||
@@ -8,4 +8,5 @@ export const config: IOption = {
|
|||||||
// id: 'the user's unique identifier'
|
// id: 'the user's unique identifier'
|
||||||
// }
|
// }
|
||||||
devModePassword: '-',
|
devModePassword: '-',
|
||||||
|
enableDataSync: !!process.env['AFFINE_FEATURE_FLAG_TOKEN'],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user