Skip to content

Commit ea6b7d3

Browse files
committed
fix(event emission): Only listen once to changes
1 parent 9f5c143 commit ea6b7d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,14 @@ const patternlab_module = function(config) {
372372
copier()
373373
.copyAndWatch(patternlab.config.paths, patternlab, options)
374374
.then(() => {
375-
this.events.on('patternlab-pattern-change', () => {
375+
this.events.once(events.PATTERNLAB_PATTERN_CHANGE, f => {
376376
if (!patternlab.isBusy) {
377377
return this.build(options);
378378
}
379379
return Promise.resolve();
380380
});
381381

382-
this.events.on('patternlab-global-change', () => {
382+
this.events.once(events.PATTERNLAB_GLOBAL_CHANGE, () => {
383383
if (!patternlab.isBusy) {
384384
return this.build(
385385
Object.assign({}, options, { cleanPublic: true }) // rebuild everything

0 commit comments

Comments
 (0)