Observables are producers that can return many values asynchronously
Producers determine when the values are sent (PUSH)
Observable executions are NOT shared
setTimeout(() => foo.subscribe)
foo.subscribe
^^ these will produce different values
An observable is a way of representing many values being delivered from a producer to a consumer.
The Producer is lazy so it only starts delivering values once we call subscribe.
The Consumer is a set of callbacks (next, error, complete)
The godocs have been a good source of ELI5 explinations of these concepts for me.
https://blog.golang.org/pipelines
^^cmd+F the following on above link:
- What is a pipeline?
- Fan-out, fan-in
http://divan.github.io/posts/go_concurrency_visualize/
Resources
- https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
- https://medium.com/@benlesh/hot-vs-cold-observables-f8094ed53339#.m37sdp37o
- https://en.wikipedia.org/wiki/Observer_pattern
- https://www.gitbook.com/book/btroncone/learn-rxjs/details
- http://stackoverflow.com/questions/1028250/what-is-functional-reactive-programming
Libraries
- https://github.com/ReactiveX/rxjs (!! lowercase rxjs === v5 RxJS === v4)
- https://rpominov.github.io/kefir/ **
- https://baconjs.github.io/
- https://github.com/cujojs/most (growing fast) **
Tools