RxJS has these 4 parts:
- callback
- creating new callbacks from original
- callback caller
- startup
I like to think of it like this:
//observerconst callback = value => {console.log(value)}//observableconst callbackCaller = callback => {document.addEventListener('click', callback)}//mapconst transform = x => x + 1//internalsconst createNewCallbackFromTransform = (transform, callback) => {const newCallback = value => callback(transform(value))return newCallback}//subscribecallbackCaller(createNewCallbackFromTransform(transform, callback))