function afterFrame(callback) {
  if (callbacks.push(callback) === 1) {
    requestAnimationFrame(postMessage);
  }
}
/**
 * Invoke the given callback after the browser renders the next frame
 * @param {(time: number) => void} callback The function to call after the browser renders
 * the next frame. The callback function is passed one argument, a DOMHighResTimeStamp
 * similar to the one returned by performance.now(), indicating the point in time when
 * afterFrame() starts to execute callback functions.
 */
Invoke the given callback after the browser renders the next frame
@param {(time: number) => void} callback The function to call after the browser renders
the next frame. The callback function is passed one argument, a DOMHighResTimeStamp
similar to the one returned by performance.now(), indicating the point in time when
afterFrame() starts to execute callback functions.
Invoke the given callback after the browser renders the next frame @param { ( time : number ) = > void } callback The function to call after the browser renders the next frame . The callback function is passed one argument a DOMHighResTimeStamp similar to the one returned by performance . now () indicating the point in time when afterFrame () starts to execute callback functions .
function afterFrame(callback) {
  if (callbacks.push(callback) === 1) {
    requestAnimationFrame(postMessage);
  }
}
function afterFrame ( callback ) { if ( callbacks . push ( callback ) === 1 ) { requestAnimationFrame ( postMessage ) ; } }
Invoke the given callback after the browser renders the next frame
 @param {(time: number) => void} callback The function to call after the browser renders
 the next frame.
Invoke the given callback after the browser renders the next frame @param { ( time : number ) = > void } callback The function to call after the browser renders the next frame .