Skip to content

Instantly share code, notes, and snippets.

@mikaelbr
Created February 23, 2015 22:18
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 mikaelbr/7059b39405969a8f8c64 to your computer and use it in GitHub Desktop.
Save mikaelbr/7059b39405969a8f8c64 to your computer and use it in GitHub Desktop.
const Tab = Component({item}, {onRemove}) => DOM.div({
className: 'tab'
/* ... */
}, [
DOM.button({onClick: onRemove})
])
const TabDeck = Component(items => DOM.div({
className: 'tabs'
/* .... */
}, items.map(item => Tab({item, { statics: { onRemove: () => items.remove(item) } } ));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment