Skip to content

Commit

Permalink
Allow same action name on diffrent ActionClasses
Browse files Browse the repository at this point in the history
without this there can be for example only one action named 'update'.
with this you can have multiple ActionClasses with same actions.

class UserActions {
	constructor() { this.generateActions('update'); }
}
module.exports = alt.createActions(UserActions);

class LinkActions {
	constructor() { this.generateActions('update'); }
}
module.exports = alt.createActions(LinkActions);
  • Loading branch information
quazzie committed Feb 10, 2015
1 parent a499d56 commit b17d392
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ your own custom identifier for each store`

return Object.keys(actions).reduce((obj, action) => {
let constant = formatAsConstant(action)
let actionName = Symbol.for(`action ${action}`)
let actionName = Symbol.for(`action ${ActionsClass.name} ${action}`)

// Wrap the action so we can provide a dispatch method
let newAction = new ActionCreator(
Expand Down

0 comments on commit b17d392

Please sign in to comment.