function nextFrame() {
  return new Promise(resolve => {
    requestAnimationFrame(() => resolve());
  });
}
Resolves after requestAnimationFrame.

@example
await nextFrame();

@returns {Promise<void>} Promise that resolved after requestAnimationFrame