Skip to content

Instantly share code, notes, and snippets.

@DrBoolean
Created July 20, 2017 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DrBoolean/192a4182607566e9bb68e525c9ca1346 to your computer and use it in GitHub Desktop.
Save DrBoolean/192a4182607566e9bb68e525c9ca1346 to your computer and use it in GitHub Desktop.
rep2
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