Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | let _enable_super_gross_mode_that_will_cause_bad_things = false;
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * The global configuration object for RxJS, used to configure things
|
---|
5 | * like what Promise contructor should used to create Promises
|
---|
6 | */
|
---|
7 | export const config = {
|
---|
8 | /**
|
---|
9 | * The promise constructor used by default for methods such as
|
---|
10 | * {@link toPromise} and {@link forEach}
|
---|
11 | */
|
---|
12 | Promise: undefined as PromiseConstructorLike,
|
---|
13 |
|
---|
14 | /**
|
---|
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.
|
---|
21 | */
|
---|
22 | set useDeprecatedSynchronousErrorHandling(value: boolean) {
|
---|
23 | if (value) {
|
---|
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');
|
---|
28 | }
|
---|
29 | _enable_super_gross_mode_that_will_cause_bad_things = value;
|
---|
30 | },
|
---|
31 |
|
---|
32 | get useDeprecatedSynchronousErrorHandling() {
|
---|
33 | return _enable_super_gross_mode_that_will_cause_bad_things;
|
---|
34 | },
|
---|
35 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.