kefirjs / kefir

A Reactive Programming library for JavaScript
https://kefirjs.github.io/kefir/
MIT License
1.87k stars 97 forks source link

Stream from promise does not handle exceptions properly #248

Closed mehtonen-boox closed 7 years ago

mehtonen-boox commented 7 years ago

Seems like errors are swallowed when stream is created out of promise. Also onError handler does not work properly. Am I misusing library or is it a bug?

const stream = kefir.fromPromise(Promise.resolve())
  .map(e => {
    throw new Error('This error is swallowed');
  });

stream.onValue(() => {
  console.log('onValue is not invoked');
});

stream.onError(() => {
  console.log('onError is not invoked');
});
mehtonen-boox commented 7 years ago

Nevermind. It was issue with https://limonte.github.io/sweetalert2/ which extends Promise prototype with done method.

limonte commented 6 years ago

https://limonte.github.io/sweetalert2/

this link is outdated, here's the correct one https://sweetalert2.github.io/