UNPKG

react-elegant-ui

Version:

Elegant UI components, made by BEM best practices for react

12 lines 296 B
/** * Flatten array * * Handler take basic item and return result item or array of it * and array will flatten */ export var flatMap = function (itemList, fn) { return itemList.reduce(function (prev, item) { var handledData = fn(item); return prev.concat(handledData); }, []); };