https://www.growthbook.io/ logo
b

bitter-river-56871

01/03/2023, 9:11 AM
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

brash-controller-43429

01/03/2023, 9:22 AM
f

future-teacher-7046

01/03/2023, 9:58 AM
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

bitter-river-56871

01/03/2023, 10:00 AM
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

green-memory-69829

01/09/2023, 10:44 PM
@bitter-river-56871 +1, using SWR with a similar implementation