yalishizhude/RxWX

Error: no Promise impl found

Closed this issue · 1 comments

Promise 貌似没有兼容

const source = Rx.Observable.create(observer => {
        observer.next('foo');

        setTimeout(function() {
          observer.next('bar');
        }, 1000);
      })

      const source1 = source.map(val => `hello ${val}`);

      const subscription = source1.subscribe(value => console.log(value));

      subscription.next('foo1');

      const promise = source1.forEach(value => {
        console.log(value);
      });

      promise.then(()=>console.log('complete'), (err)=>console.log(err));

image
添加了一行