This reverts commit 63b7b598cb
.
Causing issues in production builds
This commit is contained in:
parent
d0427919f1
commit
531fc1d754
|
@ -1,13 +1,8 @@
|
|||
import { registerWaiter } from "@ember/test";
|
||||
|
||||
/**
|
||||
* Runs `callback` shortly after the next browser Frame is produced.
|
||||
* ref: https://webperf.tips/tip/measuring-paint-time
|
||||
*/
|
||||
export default function runAfterFramePaint(callback) {
|
||||
let done = false;
|
||||
registerWaiter(() => done);
|
||||
|
||||
// Queue a "before Render Steps" callback via requestAnimationFrame.
|
||||
requestAnimationFrame(() => {
|
||||
// MessageChannel is one of the highest priority task queues
|
||||
|
@ -15,10 +10,7 @@ export default function runAfterFramePaint(callback) {
|
|||
const messageChannel = new MessageChannel();
|
||||
|
||||
// Setup the callback to run in a Task
|
||||
messageChannel.port1.onmessage = () => {
|
||||
done = true;
|
||||
callback();
|
||||
};
|
||||
messageChannel.port1.onmessage = callback;
|
||||
|
||||
// Queue the Task on the Task Queue
|
||||
messageChannel.port2.postMessage(undefined);
|
||||
|
|
Loading…
Reference in New Issue