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?
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).
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,
01/09/2023, 10:44 PM
@bitter-river-56871 +1, using SWR with a similar implementation