Skip to content

Commit 5d3e45c

Browse files
committed
type flag
1 parent 37d8258 commit 5d3e45c

File tree

7 files changed

+5
-2
lines changed

7 files changed

+5
-2
lines changed

.github/copilot-instructions-test.md

Whitespace-only changes.

.github/copilot-instructions.md

Whitespace-only changes.

lib/.copilot-instructions.md

Whitespace-only changes.

lib/core/.copilot-instructions.md

Whitespace-only changes.

lib/feature_toggle.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@
3131
* flag and all associated checks can be removed from the codebase.
3232
*/
3333

34-
export const holdout = () => true;
34+
export const holdout = () => false as const;
35+
36+
export type IfActive<T extends () => boolean, Y, N = unknown> = ReturnType<T> extends true ? Y : N;

lib/notification_center/type.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
} from '../shared_types';
2727
import { DecisionSource } from '../utils/enums';
2828
import { Nullable } from '../utils/type';
29+
import { holdout, IfActive } from '../feature_toggle';
2930

3031
export type UserEventListenerPayload = {
3132
userId: string;
@@ -34,7 +35,7 @@ export type UserEventListenerPayload = {
3435

3536
export type ActivateListenerPayload = UserEventListenerPayload & {
3637
experiment: Experiment | null;
37-
holdout: Holdout | null;
38+
holdout: IfActive<typeof holdout, Holdout | null>;
3839
variation: Variation | null;
3940
logEvent: LogEvent;
4041
}

lib/utils/.copilot-instructions.md

Whitespace-only changes.

0 commit comments

Comments
 (0)