Map/reduce patterns

We'll close the chapter with an introduction to some basic map/reduce patterns, applicable to everything you've learned in this chapter so far. First, we'll take a look at what generic callback functions look like and why they're useful. Then we'll introduce the notion of map/reduce chains.

Generic callback functions

As the development of your frontend application progresses, you'll start to notice that there is some commonality between all of your map/reduce callback functions. In other words, you could probably factor the generic aspects of the callbacks into a single generic callback. As you've seen throughout this chapter and the previous chapter, it's easy to partially apply and compose new functions with Lo-Dash. This is ...

Get Lo-Dash Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.