@codefresh-io/eventbus 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -88,7 +88,7 @@ class EventBus extends EventEmitter {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
_emitReady() {
|
|
91
|
-
if (this.busReady
|
|
91
|
+
if (this.busReady) {
|
|
92
92
|
this.readyDeferred.resolve();
|
|
93
93
|
debug('ready');
|
|
94
94
|
this.emit('ready');
|
|
@@ -99,9 +99,10 @@ class EventBus extends EventEmitter {
|
|
|
99
99
|
return Promise.resolve()
|
|
100
100
|
.then(async () => {
|
|
101
101
|
await this.readyPromise;
|
|
102
|
-
await this.store.save(eventName, msg);
|
|
103
102
|
await this.bus.publish(eventName, msg);
|
|
104
|
-
})
|
|
103
|
+
}).then(() => {
|
|
104
|
+
this.store.save(eventName, msg);
|
|
105
|
+
})
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
subscribe(eventName, handler, options) {
|