TrueCar / react-launch-darkly

Simple component helpers to support LaunchDarkly in your React app.
MIT License
76 stars 20 forks source link

Bugfix: Handle Multiple Ready Calls #26

Closed jacobmoretti closed 7 years ago

jacobmoretti commented 7 years ago

Problem

LaunchDarkly's js client on('ready', () => {}) function seems to only fire upon initialization of the client and will not re-fire for subsequent calls. This is problematic for the FeatureFlagRenderer component since it will call it each time it is rendered.

Solution

Keep track of the state of the client and queue up any events that need to fire. Longterm, we need to use redux or something to manage state better.

sethbattin commented 7 years ago

:+1: