Skip to content

Instantly share code, notes, and snippets.

@jongacnik
Last active January 2, 2018 19:45
Show Gist options
  • Save jongacnik/aae2225406a153211f9898bac02cb329 to your computer and use it in GitHub Desktop.
Save jongacnik/aae2225406a153211f9898bac02cb329 to your computer and use it in GitHub Desktop.
module.exports = function (state, emitter, app) {
state.component = require('component-box')
app.component = function (key, Component) {
if (!key || !Component) return
var obj = {}
obj[key] = function () {
return new Component()
}
state.component.use(obj)
}
}
{
"name": "choo-component",
"version": "0.0.0",
"main": "choo-component.js",
"dependencies": {
"component-box": "^0.1.6"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment