jeffbcross / aim

82 stars 27 forks source link

refactor(typeahead): move response unwrapping to separate combinator … #23

Closed jeffbcross closed 8 years ago

jeffbcross commented 8 years ago

…for readability

In order to reduce the cognitive overhead of understanding the chain of combinators, I moved the res.json() step to a separate map operation after the fact.

Since this isn't a performance-critical hot path, the cost of separating into a separate step isn't a big concern.

If @blesh's demo goes deep into the power of switchMap, then we can leave it as is, but @robwormald and I were hoping to simplify by breaking into two steps.

jeffbcross commented 8 years ago

@blesh thoughts?

jeffbcross commented 8 years ago

Made obsolete by 82f60ce404b1a86898544b5bf4108a6cc2994234