【问题标题】:combine latest is not triggering properly in Firefox and IEcombine latest 在 Firefox 和 IE 中未正确触发
【发布时间】:2020-06-01 07:14:37
【问题描述】:

我有一个行为主题布尔值,它被分配给一个可观察对象。我在 combineLatest 中使用这个 observable。在 Chrome 和其他浏览器(Firefox 和 IE 除外)中,只要行为主题值发生更改,就会触发此组合最新。仅在 Firefox 和 IE 中,这是间歇性工作的。

【问题讨论】:

    标签: javascript rxjs observable rxjs6


    【解决方案1】:

    您遇到的问题不属于 rxjs,而是在 IE 中不存在且需要 polyfill 的代码中使用的函数。

    例如,Map Set Array 的方法在 IE 中不存在,但在 Edge 或 Chrome 中存在。

    如果你想调试它 - 在 IE 中打开开发人员工具找到错误,从错误中你可以了解应该添加哪个 polyfill,然后简单地用类似的东西更新polyfills.ts

    import '@angular/localize/init';
    import 'classlist.js';
    import 'core-js/es6/array';
    import 'core-js/es6/date';
    import 'core-js/es6/function';
    import 'core-js/es6/map';
    import 'core-js/es6/math';
    import 'core-js/es6/number';
    import 'core-js/es6/object';
    import 'core-js/es6/parse-float';
    import 'core-js/es6/parse-int';
    import 'core-js/es6/reflect';
    import 'core-js/es6/regexp';
    import 'core-js/es6/set';
    import 'core-js/es6/string';
    import 'core-js/es6/symbol';
    import 'core-js/es6/weak-map';
    import 'core-js/es7/array';
    import 'core-js/es7/reflect';
    import 'url-polyfill';
    import 'web-animations-js';
    import 'whatwg-fetch';
    import 'zone.js/dist/zone';
    

    【讨论】:

      猜你喜欢
      • 2015-03-03
      • 2013-12-20
      • 1970-01-01
      • 2012-02-10
      • 2015-08-20
      • 2012-04-21
      • 1970-01-01
      • 2012-05-26
      • 2014-04-06
      相关资源
      最近更新 更多