Decorating functions
A decorator does what the name implies. It decorates functions with additional capabilities. It's like an adornment for a piece of functionality. For example, let's say we've already implemented a function that looks up data in some structure. It's already used throughout our application, but now we're implementing a new component that requires this same functionality and something extra. We can use the function-decorating tools provided by Lo-Dash to take existing functions and extend them.
There are two flavors of Lo-Dash function decoration: Partials, which construct new functions that have the arguments of the original function partially supplied, and Wrappers, which build a new function that wraps the original function ...
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.