Fork me on GitHub
#re-frame
<
2020-06-16
>
dazld17:06:59

hey, just wondering if any of you have come across this before - dispatches aren't processed in safari when the browser window isn't active.

dazld17:06:00

the queues are processed when the tab is made active / browser window becomes visible etc

dazld17:06:29

not just safari, so I guess this is by design?

folcon17:06:41

Oh, you might be hitting a requestanimationframe thing? Reframe uses that for working out when to re-run computations. I believe browsers pause that when the window is inactive. Docs reference: https://github.com/day8/re-frame/blob/master/docs/flow-mechanics.md#truth-interlude

👍 3
dazld18:06:15

yep, rAF is paused when the tab isn't visible

dazld18:06:52

@U051091NM setImmediate calls aren't processed in the background, when tabs are inactive?

dazld18:06:52

oh, there's terrible browser support for it! looks like nextTick will almost always use the polyfill

dazld18:06:34

so i guess what's happening is that the dispatch queue is being processed, but the reactions aren't.

dima19:06:57

@U3ZUC5M0R you’re right. background timers are processed in background (no more than 1 per sec though in Chrome) https://developers.google.com/web/updates/2017/03/background_tabs#background_timer_alignment but rAF is not

dazld19:06:02

Super interesting, thanks!

folcon17:06:03

Has anyone used re-frame + react-native with microsoft’s new macos and windows targets?

👀 3
3