Skip to content

Commit

Permalink
merge methods with data
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 15, 2017
1 parent 9b90318 commit 416c10a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@
this.$hooks = this.$opts.hooks || {};

// Custom Methods
this.$methods = this.$opts.methods || {};
extend(this.$data, this.$opts.methods || {});

// Pool of Events
this.$events = {};
Expand Down Expand Up @@ -1700,7 +1700,7 @@
args = args || [];

// Call method in context of instance
this.$methods[method].apply(this, args);
this.$data[method].apply(this, args);
};

// Event Emitter, adapted from https://github.com/KingPixil/voke
Expand Down
2 changes: 1 addition & 1 deletion dist/moon.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function Moon(opts) {
this.$hooks = this.$opts.hooks || {};

// Custom Methods
this.$methods = this.$opts.methods || {};
extend(this.$data, this.$opts.methods || {});

// Pool of Events
this.$events = {};
Expand Down
2 changes: 1 addition & 1 deletion src/instance/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Moon.prototype.callMethod = function(method, args) {
args = args || [];

// Call method in context of instance
this.$methods[method].apply(this, args);
this.$data[method].apply(this, args);
}

// Event Emitter, adapted from https://github.com/KingPixil/voke
Expand Down

0 comments on commit 416c10a

Please sign in to comment.