You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to attach a notification listener to my team's client instance so we can create an event and pass along to our analytics provider. Specifically, I wanted to attach an ACTIVATE listener. I'd like to create the callback for this outside the call to addNotificationListener and have it be typed. I see the type that this function is expecting is :
The file containing this type also contains other derived types like: ActivateListenerPayload .
While I can derive the less specific type ListenerPayload like this:
type Callback = Parameters<typeof optimizely.notificationCenter.addNotificationListener>[1];
I wish I could import the type from @optimizely/react-sdk via this package , but the types are not exported here.
Furthermore this is the more generic type and what I truly want to use in this case is ActivateListenerPayload .
Is there a reason the types are not exported for use? Or advise what to do in this case to make my function type safe? Thank you!
The text was updated successfully, but these errors were encountered:
…ad` (#150)
### Summary
`ActivateListenerPayload` and `TrackListenerPayload` types were exported from `@optimizely/optimizely-sdk` but were missing in `@optimizely/react-sdk` exports.
### Test Plan
Manually tested thoroughly.
All existing unit tests pass.
### Issues
#121
Hello,
I wanted to attach a notification listener to my team's client instance so we can create an event and pass along to our analytics provider. Specifically, I wanted to attach an
ACTIVATE
listener. I'd like to create the callback for this outside the call toaddNotificationListener
and have it be typed. I see the type that this function is expecting is :NotificationListener<T extends ListenerPayload> = (notificationData: T) => void;
which comes from
@optimizely/optimizely-sdk
.The file containing this type also contains other derived types like:
ActivateListenerPayload
.While I can derive the less specific type
ListenerPayload
like this:type Callback = Parameters<typeof optimizely.notificationCenter.addNotificationListener>[1];
I wish I could import the type from
@optimizely/react-sdk
via this package , but the types are not exported here.Furthermore this is the more generic type and what I truly want to use in this case is
ActivateListenerPayload
.Is there a reason the types are not exported for use? Or advise what to do in this case to make my function type safe? Thank you!
The text was updated successfully, but these errors were encountered: