Skip to content

Commit

Permalink
Simplify the name for #3 from .into to .to
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanve committed May 3, 2014
1 parent 91f88b6 commit 140dcd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* @param {Object|Function} target to convert into emitter
* @return {Object|Function} target converted into emitter
*/
energy['into'] = function(target) {
energy['to'] = function(target) {
return defaults(target, this.call());
};

Expand All @@ -54,7 +54,7 @@
* @param {Object|Energy|Function} target to convert into emitter
* @return {Object|Energy|Function} source for chaining
*/
emitter['into'] = function(target) {
emitter['to'] = function(target) {
defaults(target, this);
return this;
};
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
aok('instance', emitter instanceof energy);
aok('listeners', typeof emitter.listeners(key).length == 'number');

aok('into', function() {
aok('to', function() {
function wannabe() {
wannabe.emit('called');
}

var bool = wannabe === energy.into(wannabe) && typeof wannabe.emit == 'function';
var bool = wannabe === energy.to(wannabe) && typeof wannabe.emit == 'function';
bool && wannabe.once('called', function() {
bool = this === wannabe;
}) && wannabe();
Expand Down

0 comments on commit 140dcd6

Please sign in to comment.