react/packages/scheduler
Andrew Clark 629125555f
[Scheduler] Re-throw unhandled errors (#19595)
Because `postTask` returns a promise, errors inside a `postTask`
callback result in the promise being rejected.

If we don't catch those errors, then the browser will report an
"Unhandled promise rejection" error. This is a confusing message to see
in the console, because the fact that `postTask` is a promise-based API
is an implementation detail from the perspective of the developer.
"Promise rejection" is a red herring.

On the other hand, if we do catch those errors, then we need to report
the error to the user in some other way.

What we really want is the default error reporting behavior that a
normal, non-Promise browser event gets.

So, we'll re-throw inside `setTimeout`.
2020-08-12 20:06:43 -07:00
..
npm Add postTask browser scheduler implementation (#19479) 2020-07-29 15:27:59 -04:00
src [Scheduler] Re-throw unhandled errors (#19595) 2020-08-12 20:06:43 -07:00
README.md Rename schedule to scheduler (#13683) 2018-09-19 01:26:28 +01:00
index.js Rename schedule to scheduler (#13683) 2018-09-19 01:26:28 +01:00
package.json Add postTask browser scheduler implementation (#19479) 2020-07-29 15:27:59 -04:00
tracing.js Rename schedule to scheduler (#13683) 2018-09-19 01:26:28 +01:00
unstable_mock.js Prefix mock Scheduler APIs with _unstable (#15999) 2019-06-26 12:16:08 -07:00
unstable_post_task.js [Scheduler] Call postTask directly (#19551) 2020-08-12 08:39:47 -05:00

README.md

scheduler

This is a package for cooperative scheduling in a browser environment. It is currently used internally by React, but we plan to make it more generic.

The public API for this package is not yet finalized.

Thanks

The React team thanks Anton Podviaznikov for donating the scheduler package name.