Skip to content

Conversation

@junaed-optimizely
Copy link
Contributor

Summary

Notification center listener callback type definition update

Test plan

Existing tests should pass

Issues

  • FSSDK-12115

@coveralls
Copy link

coveralls commented Dec 4, 2025

Coverage Status

coverage: 90.348% (+0.001%) from 90.347%
when pulling 37c9675 on junaed/fssdk-12115-notification-center-type
into 34682ea on 5.x.x.

export interface TrackListenerPayload extends ListenerPayload {
eventKey: string;
eventTags: EventTags;
eventTags?: EventTags;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a breaking change. Need to keep this type unchanged

export interface ActivateListenerPayload extends ListenerPayload {
experiment: import('./shared_types').Experiment;
variation: import('./shared_types').Variation;
experiment?: import('./shared_types').Experiment;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be a breaking change. Need to keep this unchanged

};

export type NotificationListener<T> = (notificationData: T) => void;
export interface NotificationCenter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot modify this interface, it would be a breaking change

addNotificationListener<T extends ListenerPayload>(
notificationType: string,
callback: NotificationListener<T>
addNotificationListener<K extends keyof NotificationPayloadMap>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to keep this unchanged

export type NotificationListener<T extends ListenerPayload> = (notificationData: T) => void;
export type DecisionNotificationType = typeof DECISION_NOTIFICATION_TYPES[keyof typeof DECISION_NOTIFICATION_TYPES];

export type DecisionSource =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do type DecisionSource = typeof DECISION_SOURCES[keyof typeof DECISION_SOURCES];

@junaed-optimizely junaed-optimizely merged commit c20678f into 5.x.x Dec 8, 2025
17 of 19 checks passed
@junaed-optimizely junaed-optimizely deleted the junaed/fssdk-12115-notification-center-type branch December 8, 2025 12:49
@junaed-optimizely junaed-optimizely mentioned this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants