Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Expose ldClientWrapper to subscribe to the same ldClient events #109

Open
rrivem opened this issue Mar 6, 2020 · 1 comment
Open

Expose ldClientWrapper to subscribe to the same ldClient events #109

rrivem opened this issue Mar 6, 2020 · 1 comment

Comments

@rrivem
Copy link

rrivem commented Mar 6, 2020

We're using the FeatureFlag to render components based on LD flags and works sharp.

But now we need to know if we need to avoid rendering a whole tree based on flags and other conditions.

We tried using ldclient-js directly, but the initialize seems to be affecting the FeatureFlag rendered items we have already and not being updated when a flag changes.

We think we could leverage this by having access to the ldClientWrapper to have access to the same ldClient instance used on components

@sethbattin
Copy link
Contributor

Hi @rrivem, just to clarify the issue you're having: you need to know the value of a flag for a major section of your component tree, and the delay in loading the flags is a problem because it briefly renders the wrong content?

If so, perhaps you might benefit from the server-side rendering section of our readme. It describes how to initialize the js client with a previously-loaded set of flag values. This set of values can come from anywhere (webserver, etc) that knows the individual session's unique identifier (the same one you pass into the library), and can load them while serving your initial browser content. Then when the javascript library runs, it will use those values until it gets updates from launchdarkly's service via the js client. Launch darkly also provides useful local proxies for their service, to make certain server response time is minimal even when waiting for their data.

I hope this helps; if not please post as many details as you can so we can figure out how to solve it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants