Skip to content

Commit

Permalink
Merge pull request #340 from rentpath/cw/rename_define_1_x
Browse files Browse the repository at this point in the history
Rename define to defineComponent
  • Loading branch information
tgvashworth committed Feb 12, 2015
2 parents 04fb2eb + 65d5b0e commit 3cc137f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ define(

// define the constructor for a custom component type
// takes an unlimited number of mixin functions as arguments
// typical api call with 3 mixins: define(timeline, withTweetCapability, withScrollCapability);
function define(/*mixins*/) {
// typical api call with 3 mixins: defineComponent(timeline, withTweetCapability, withScrollCapability);
function defineComponent(/*mixins*/) {
// unpacking arguments by hand benchmarked faster
var l = arguments.length;
var mixins = new Array(l);
Expand All @@ -96,7 +96,7 @@ define(
Component.attachTo = attachTo;
// enables extension of existing "base" Components
Component.mixin = function() {
var newComponent = define(); //TODO: fix pretty print
var newComponent = defineComponent(); //TODO: fix pretty print
var newPrototype = Object.create(Component.prototype);
newPrototype.mixedIn = [].concat(Component.prototype.mixedIn);
newPrototype.defaults = utils.merge(Component.prototype.defaults);
Expand All @@ -118,13 +118,13 @@ define(
return Component;
}

define.teardownAll = function() {
defineComponent.teardownAll = function() {
registry.components.slice().forEach(function(c) {
c.component.teardownAll();
});
registry.reset();
};

return define;
return defineComponent;
}
);

0 comments on commit 3cc137f

Please sign in to comment.