Replies: 1 comment
-
Hi @oyvindneu , Have you tried out the option: const [finished, result, updating] = TestAsyncAction.useBeckon(undefined, { holdPrevious: true }); It might solve your issue here- since it forces the action to hold the previous value until the cache is updated with the new one. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to update a list of notifications maximum every 15 seconds.
So I set an intervall to use run with
respectCache = true
- this worked fine, but caused flickering of the result list, since finished was set to false while polling the notification api.To solve this I added
treatAsUpdate: true, respectCache = true
but then useBeckon will never return updating = true.The code works as I would expect if
respectCache: false, treatAsUpdate: true
.It seems like respectCache cannot be combined with treatAsUpdate - is there some other setting I have missed?
How is the intended way of solving this?
I can fix the code by only updating every 15 sec, but this would update the cache even if another event already had updated the cache (for instance if the user pressed a refresh button in the UI - onRefreshClick).
And the getNotificationAction have a cacheBreakHook to not update more frequently than.
Beta Was this translation helpful? Give feedback.
All reactions