Skip to content

Commit

Permalink
Rename define to defineComponent
Browse files Browse the repository at this point in the history
- Rename `define` to `defineComponent` in `component.js`

`component.js`'s internal `define` function can be mixed up with
AMD's use of `define` as seen in  [amd-optimize](scalableminds/amd-optimize#42)
  • Loading branch information
c0 committed Feb 10, 2015
1 parent 04fb2eb commit 65d5b0e
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 65d5b0e

Please sign in to comment.