Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

config.ts 1.4KB

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