Hey everyone, I’m playing with GrowthBook (mainly ...
# ask-questions
b
Hey everyone, I’m playing with GrowthBook (mainly to use for feature flags on React) and was wondering if you need to refetch data manually every time you turn the feature on/off? Since the example shows fetch() being triggered on main component load (e.g. on page refresh), my question is what’s the best way of refetching/pushing updated flags to user without the need for full page reload or periodically checking the endpoint for new data?
b
f
Hi. We're currently working on a better solution for this using web sockets (or similar tech). So when you change a feature in GrowthBook, all clients will automatically get the new value (within a couple seconds).
2
b
That sounds pretty sweet - I’m currently getting it with react query, invalidating cache after X minutes but it’s not the most elegant solution,
g
@bitter-river-56871 +1, using SWR with a similar implementation