kosich / rxjs-autorun

Re-evaluate an expression whenever Observable in it emits
MIT License
34 stars 2 forks source link

Suggestion: in-place error throwing #29

Open kosich opened 3 years ago

kosich commented 3 years ago

Since autorun API lets users run code in synchronous manner, it might make sense to allow handling errors right inside the expression:

computed(() => {
  try { return $(a); }
  catch(e) { return e + $(b); }
});

(I've shared this suggestion somewhere, created this issue to discuss further)