7

It seems to me like Observables are basically wrappers for promises with some helper methods. It also requires a huge library to go along with it. Do the benefits of these helper methods outweigh the cons of importing a library?

closed as too broad by Robert Harvey, gnat, Ixrec, Adam Zuckerman, Jörg W Mittag May 23 '16 at 11:13

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

8

Promises are often used to tackle problems with callbacks. Conceptually promises are futures, so the problems with futures that are mentioned in reactiveX intro link provided by Robert Harvey apply.

Conceptually promises are a subset of observables. Promise is a value that will resolve asynchronously. Most typical example is http requests. Observables deal with sequence of asynchronous events. These events could be mouse positions, clicks, user input etc. So one could say observables are richer and more complex abstraction for handling asynchronicity.

So, calling observables as promises + helper methods is an oversimplification. The answer to your question depends on whether you need to deal with sequence of events or if you can live with "simple" asynchronicity. Libraries like RxJS or Bacon or Kefir add complexity so you'll want to add them only if needed.

  • "calling observables as promises + helper methods is an oversimplification" – +1, that's like calling JavaScript "C with hashmap literals". – Jörg W Mittag May 23 '16 at 11:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.