3 ms·
From the FRP literature, an observable can be viewed as a stream of promises, something like: { "value" : ..., "next" : new Promise(...) } So it's basical
by naasking 10y ago
From the FRP literature, an observable can be viewed as a stream of promises, something like:
{ "value" : ..., "next" : new Promise(...) }
So it's basically a linked list of the current value, and the next value which is a promise for the same type of structure.
- bad_user 10y agoAn observable is definitely not a stream of promises, because an observable is push-based, while a stream of promises would be pull-based. Big difference in performance, implementation and what operations are possible or not. Even if you add back-pressure in that protocol, it's still a big difference. And yes, my point is that an observable is close to being a sort of superset of a promise, but not close enough.
- naasking 10y ago> An observable is definitely not a stream of promises, because an observable is push-based, while a stream of promises would be pull-based. Why would a stream of promises be pull-based? That seems like a pretty odd assumption to me.