posthog-js
posthog-js copied to clipboard
[React]: Multiple useFeatureFlags triggers multiple /decide calls
If you use the useFeatureFlags
-hook throughout your webapplication and have the refresh interval enabled it triggers multiple requests to the /decide
-endpoint.
Maybe its worth considering to cache the endpoint's response and allow some sort of ttl for the response? I don't think it's worth it to call this endpoint in quick succession.
For example, in my application I am using the hook in different components which triggers a bunch of /decide
-endpoints: