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.
the queues are processed when the tab is made active / browser window becomes visible etc
Has anyone used re-frame + react-native with microsoft’s new macos and windows targets?
not just safari, so I guess this is by design?
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
re-frame runs dispatch events on goog.async.nextTick https://github.com/day8/re-frame/blob/master/src/re_frame/router.cljc#L187 which seems not executed in background https://github.com/google/closure-library/blob/d55cca5b83d573f8db10f6cceae243b246db1f23/closure/goog/async/nexttick.js#L54
yep, rAF is paused when the tab isn't visible
@trybeee setImmediate calls aren't processed in the background, when tabs are inactive?
oh, there's terrible browser support for it! looks like nextTick
will almost always use the polyfill
so i guess what's happening is that the dispatch queue is being processed, but the reactions aren't.
@dazld 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
Super interesting, thanks!