Skip to content

Commit 6d5c798

Browse files
slavuganMetinSeylan
authored andcommitted
move string concatenation out of loop (MetinSeylan#189)
1 parent 60d38b7 commit 6d5c798

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/emitter.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ export default class EventEmitter{
9191

9292
if(this.store && this.store._actions){
9393

94+
let prefixed_event = this.actionPrefix + event;
95+
9496
for (let key in this.store._actions) {
9597

9698
let action = key.split('/').pop();
9799

98-
if(action === this.actionPrefix+event) {
100+
if(action === prefixed_event) {
99101

100102
Logger.info(`Dispatching Action: ${key}, Data:`, args);
101103

@@ -107,11 +109,13 @@ export default class EventEmitter{
107109

108110
if(this.mutationPrefix) {
109111

112+
let prefixed_event = this.mutationPrefix + event;
113+
110114
for (let key in this.store._mutations) {
111115

112116
let mutation = key.split('/').pop();
113117

114-
if(mutation === this.mutationPrefix+event) {
118+
if(mutation === prefixed_event) {
115119

116120
Logger.info(`Commiting Mutation: ${key}, Data:`, args);
117121

0 commit comments

Comments
 (0)