tdeekens / flopflip

🎚Flip or flop features in your React application in real-time backed by flag provider of your choice 🚦

Home Page:https://techblog.commercetools.com/embracing-real-time-feature-toggling-in-your-react-application-a5e6052716a9

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`ready` event is emitted on error when initializing client

gnerkus opened this issue · comments

Is your feature request related to a problem? Please describe.

A LaunchDarklyFlagFetchError is sometimes thrown during client initialization. This seems to occur because the ready event gets emitted as soon as the initialization logic has finished, regardless of whether it succeeded as explained here: launchdarkly/js-client-sdk#113 (comment)

Describe the solution you'd like

The ready event is only emitted on successful initialization

Describe alternatives you've considered

The waitUntilReady method call here

return adapterState.client.waitUntilReady().then(() => {

could be replaced with the waitForInitialization method as discussed here:
launchdarkly/js-client-sdk#113 (comment)

Awesome. Thanks for letting me know this exists. Wasn't aware.