repeaterjs / repeater

The missing constructor for creating safe async iterators
https://repeater.js.org
MIT License
459 stars 12 forks source link

obfuscate observable example with functional programming #47

Open jedwards1211 opened 4 years ago

jedwards1211 commented 4 years ago

this is sort of a joke but I just wanted to demonstrate that the code can be shortened, assuming there are no extra arguments in observables I don't know about.

And illustrate how it's almost exactly the same API as the Observable constructor but with an async function.

brainkim commented 4 years ago

Hahahaha if you make the observable.subscribe call a one-liner (maybe shorten subscription to sub), I will merge this in. Could be nice to show the flexibility of repeaters, how you can name the push and stop functions whatever you want.

However, the README is duplicated in the nested package README (https://github.com/repeaterjs/repeater/blob/master/packages/repeater/README.md) and the docs (https://github.com/repeaterjs/repeater/blob/master/docs/01_quickstart.md). Also I’d have to do a docs site deploy... mhmhghgh

And illustrate how it's almost exactly the same API as the Observable constructor but with an async function.

I will never acknowledge this. 🕵️‍♂️