Created
April 27, 2017 21:50
-
-
Save bherrero/2e2e7cce6a23d06cfaee45d59ff52719 to your computer and use it in GitHub Desktop.
Revisions
-
bherrero revised this gist
Apr 27, 2017 . No changes.There are no files selected for viewing
-
bherrero created this gist
Apr 27, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ // maps it's an array of objects // groupBy to extract section headers let dataSource = _.groupBy(maps, o => o.name); // reduce to generate new array dataSource = _.reduce(dataSource, (acc, next, index) => { acc.push({ key: index, data: next }); return acc; }, []); return dataSource;