Skip to content

Commit 7f44cbb

Browse files
committed
Make targetFlags doc more clear
1 parent 09166c0 commit 7f44cbb

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/initLDClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import * as packageInfo from '../package.json';
1010
* @param user A LaunchDarkly user object
1111
* @param reactOptions Initialization options for the LaunchDarkly React SDK
1212
* @param options LaunchDarkly initialization options
13-
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
13+
* @param targetFlags Set of flags that the SDK should pay attention to, as a map of keys to default values.
14+
* Only these flags will appear in the flags object, and only changes to these flags will trigger a rerender.
15+
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
1416
*
1517
* @see `ProviderConfig` for more details about the parameters
1618
* @return An initialized client and flags

src/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ export interface ProviderConfig {
6767
reactOptions?: LDReactOptions;
6868

6969
/**
70-
* If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
71-
* Otherwise, all flags will be requested and listened to.
70+
* Set of flags that the SDK should pay attention to, as a map of keys to default values.
71+
* Only these flags will appear in the flags object, and only changes to these flags will trigger a rerender.
72+
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
7273
*/
7374
flags?: LDFlagSet;
7475

src/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export const getFlattenedFlagsFromChangeset = (
5353
*
5454
* @param ldClient LaunchDarkly client
5555
* @param reactOptions Initialization options for the LaunchDarkly React SDK
56-
* @param targetFlags If specified, `launchdarkly-react-client-sdk` will only request and listen to these flags.
56+
* @param targetFlags Set of flags that the SDK should pay attention to, as a map of keys to default values.
57+
* Only these flags will appear in the flags object, and only changes to these flags will trigger a rerender.
58+
* Flag keys must be in their original form as known to LaunchDarkly rather than in their camel-cased form.
5759
*
5860
* @returns an `LDFlagSet` with the current flag values from LaunchDarkly filtered by `targetFlags`.
5961
*/

0 commit comments

Comments
 (0)