1 let _enable_super_gross_mode_that_will_cause_bad_things = false;
4 * The global configuration object for RxJS, used to configure things
5 * like what Promise contructor should used to create Promises
7 export const config = {
9 * The promise constructor used by default for methods such as
10 * {@link toPromise} and {@link forEach}
12 Promise: undefined as PromiseConstructorLike,
15 * If true, turns on synchronous error rethrowing, which is a deprecated behavior
16 * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe
17 * call in a try/catch block. It also enables producer interference, a nasty bug
18 * where a multicast can be broken for all observers by a downstream consumer with
19 * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BY TIME
20 * FOR MIGRATION REASONS.
22 set useDeprecatedSynchronousErrorHandling(value: boolean) {
24 const error = new Error();
25 console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
26 } else if (_enable_super_gross_mode_that_will_cause_bad_things) {
27 console.log('RxJS: Back to a better error behavior. Thank you. <3');
29 _enable_super_gross_mode_that_will_cause_bad_things = value;
32 get useDeprecatedSynchronousErrorHandling() {
33 return _enable_super_gross_mode_that_will_cause_bad_things;