Created
July 20, 2017 16:35
-
-
Save DrBoolean/192a4182607566e9bb68e525c9ca1346 to your computer and use it in GitHub Desktop.
rep2
This file contains 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 characters
const Components = [‘alert’, ‘buttons’, ‘data-tables’, /* …etc */] | |
// build a Map of just {key: key} | |
const empty = Components.reduce((acc, key) => acc.set(key, key), Immutable.Map()) | |
// load up each component | |
const ui = empty.map(loadComponent).map(addExample).map(beautifyHtml).map(addSelectorTable) | |
// access a component | |
ui.get(‘buttons’) // { "name": "Buttons", "example": Maybe.Just(Task), "html": Maybe.Just(<some html>), "selectors": Maybe.Just(cols,rows) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment