getify / Functional-Light-JS

Pragmatic, balanced FP in JavaScript. @FLJSBook on twitter.
http://FLJSBook.com
Other
16.6k stars 1.95k forks source link

Tech Edit: Ch10 #74

Closed DrBoolean closed 7 years ago

DrBoolean commented 7 years ago

Another great chapter with 0 tech issues.

The lazy map intuition you provide here is the basis of many o' functor and it's crystal clear. Promises and Observables are spot on for async FP and cover the cases most people ever need.

Again, no tech errors, just some thoughts:

Initially, I started looking for a record variable somewhere. I'm pretty sure you were referring to the customerRecord var from the previous example or just the response in customerPromise in general, but it took a second.

I was surprised when I read: It's not necessary to assign the observable to b and then call b.subscribe(..) separately from the chain; that's only done to reinforce that each operator returns a new observable from the previous one because, fp'ers do that very much on purpose to keep b pure - had subscribe() been at the end of the chain, b would lose its purity.

That's really it. Do with that what you will :) I'm just throwing in my two cents.