Skip to content

Commit

Permalink
Actions on this
Browse files Browse the repository at this point in the history
  • Loading branch information
goatslacker committed Apr 16, 2015
1 parent 478ed8f commit 752995d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/alt-browser-with-addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ var Alt = (function () {
return ActionsGenerator;
})(ActionsClass);

new ActionsGenerator(_this8);
assign(actions, new ActionsGenerator(_this8));
})();
} else {
assign(actions, ActionsClass);
Expand Down
2 changes: 1 addition & 1 deletion dist/alt-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ var Alt = (function () {
return ActionsGenerator;
})(ActionsClass);

new ActionsGenerator(_this8);
assign(actions, new ActionsGenerator(_this8));
})();
} else {
assign(actions, ActionsClass);
Expand Down
2 changes: 1 addition & 1 deletion dist/alt-with-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ var Alt = (function () {
return ActionsGenerator;
})(ActionsClass);

new ActionsGenerator(_this8);
assign(actions, new ActionsGenerator(_this8));
})();
} else {
assign(actions, ActionsClass);
Expand Down
2 changes: 1 addition & 1 deletion dist/alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ var Alt = (function () {
return ActionsGenerator;
})(ActionsClass);

new ActionsGenerator(_this8);
assign(actions, new ActionsGenerator(_this8));
})();
} else {
assign(actions, ActionsClass);
Expand Down
2 changes: 1 addition & 1 deletion src/alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class Alt {
}
}

new ActionsGenerator(this)
assign(actions, new ActionsGenerator(this))
} else {
assign(actions, ActionsClass)
}
Expand Down
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class MyActions {
'updateAnotherVal'
)
this.generateActions('anotherAction')

this.actionOnThis = function (x) {
this.dispatch(x)
}
}

updateName(name) {
Expand Down Expand Up @@ -435,6 +439,7 @@ const tests = {
assert.isFunction(myShorthandActions.actionTwo, 'other action created with shorthand createActions exists')
assert.isFunction(objActions.hello, 'actions created by obj are functions')
assert.isFunction(objActions.world, 'actions created by obj are functions')
assert.isFunction(myActions.actionOnThis, 'actions defined in `this` are functions')
},

'existence of constants'() {
Expand Down

0 comments on commit 752995d

Please sign in to comment.