Update data from polling only when the data changes
I have react query hook with refetchInterval of 5s
I want the query.data to be updated only if the new data has actually changed. How can I achieve it?
Further explanation about the usage:
I have 2 react query hooks, one that happens once, when the app is loaded, the second one is polling every x seconds.
I have a third hook, that builds a united object of both. But I don't wan't the rebuild the united object if the polling data hasn't been changed.
Hence I would like the query.data to be updated only if the new data has actually changed
2 Replies
genetic-orange•3y ago
That should happen automatically per default
harsh-harlequin•3y ago
I would set key of 3rd query to be something that is unique in query 2 response