function scheduleMicrotask(callback) {
  Promise.resolve()
    .then(callback)
    .catch(error =>
      setTimeout(() => {
        throw error
      })
    )
}
Schedules a microtask.
This can be useful to schedule state updates after rendering.