Skip to content

Instantly share code, notes, and snippets.

@jaredly
Created July 26, 2014 03:20
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 jaredly/8fc3195038e606411777 to your computer and use it in GitHub Desktop.
Save jaredly/8fc3195038e606411777 to your computer and use it in GitHub Desktop.
mixin factories
var MyMixin = require('my-mixin')
// way one
var App = React.createClass({
mixins: [MyMixin],
stuffForMyMixin: {
aVariable: 12,
aFunction: function () {
// etc.
}
}
})
// way two
var App = React.createClass({
mixins: [MyMixin({
aVariable: 12,
aFunction: function () {
// etc.
}
})]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment