Closed marcocaldera closed 8 months ago
Hello @marcocaldera, sorry for the late reply and thank you for the request. We will need to look into this more, as I don't know the reason off the top of my head. I will look into the answer and provide another response. For now, I am marking this as an enhancement.
The react-native SDK has been re-written and released. The new version v10 is purely in TypeScript and supports Expo. It now uses an EventEmitter pattern for subscribing to changes. To subscribe tp changes, use the on
function. You will still need to specify the callback when you unsubscribe, because internally we also use these listeners and so the client needs to know exactly which function to unsubscribe.
Please consider upgrading to v10. Thank you for your patience.
This issue is marked as stale because it has been open for 30 days without activity. Remove the stale label or comment, or this will be closed in 7 days.
Is your feature request related to a problem? Please describe. I was trying to listen to flag changes and I was wondering why
unregisterFeatureFlagListener
force us to pass a callback as an argument. What's the requirement behind it?It also seems that unless the callback used in
registerFeatureFlagListener
is the same as the one used inunregisterFeatureFlagListener
the system do not fully unsubscribe to that listener.Describe the solution you'd like I would like to see decoupled the callback and subscription to a listener.
Additional context That has been my brief understanding. I'm obviously super happy to hear the reasoning.