Skip to content

Commit acae484

Browse files
prepare 3.2.8 release (#24)
1 parent 73c9a61 commit acae484

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

test-types.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ var user: ld.LDUser = {
3333

3434
var client: ld.LDClientBase = {} as ld.LDClientBase; // wouldn't do this in real life, it's just so the following statements will compile
3535

36+
client.waitUntilReady().then(() => {});
37+
client.waitForInitialization().then(() => {});
38+
39+
client.identify(user).then(() => {});
40+
client.identify(user, undefined, () => {});
41+
client.identify(user, 'hash').then(() => {});
42+
43+
var user: ld.LDUser = client.getUser();
44+
45+
client.flush(() => {});
46+
client.flush().then(() => {});
47+
3648
var boolFlagValue: ld.LDFlagValue = client.variation('key', false);
3749
var numberFlagValue: ld.LDFlagValue = client.variation('key', 2);
3850
var stringFlagValue: ld.LDFlagValue = client.variation('key', 'default');
@@ -43,5 +55,19 @@ var detailValue: ld.LDFlagValue = detail.value;
4355
var detailIndex: number | undefined = detail.variationIndex;
4456
var detailReason: ld.LDEvaluationReason = detail.reason;
4557

58+
client.setStreaming(true);
59+
client.setStreaming();
60+
61+
function handleEvent() {}
62+
client.on('event', handleEvent);
63+
client.off('event', handleEvent);
64+
65+
client.track('event');
66+
client.track('event', { someData: 'x' });
67+
client.track('event', null, 3.5);
68+
4669
var flagSet: ld.LDFlagSet = client.allFlags();
4770
var flagSetValue: ld.LDFlagValue = flagSet['key'];
71+
72+
client.close(() => {});
73+
client.close().then(() => {});

typings.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,13 @@ declare module 'launchdarkly-js-sdk-common' {
651651
* The name of the event, which may correspond to a goal in A/B tests.
652652
* @param data
653653
* Additional information to associate with the event.
654+
* @param metricValue
655+
* An optional numeric value that can be used by the LaunchDarkly experimentation
656+
* feature in numeric custom metrics. Can be omitted if this event is used by only
657+
* non-numeric metrics. This field will also be returned as part of the custom event
658+
* for Data Export.
654659
*/
655-
track(key: string, data?: any): void;
660+
track(key: string, data?: any, metricValue?: number): void;
656661

657662
/**
658663
* Returns a map of all available flags to the current user's values.

0 commit comments

Comments
 (0)