Adds publish/subscribe pattern to allow plugins and projects to hook into events (#55)
Also adds CLI to ease development.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
class CartSubscriber {
|
||||
constructor({ cartService, eventBusService }) {
|
||||
this.eventBus_ = eventBusService
|
||||
|
||||
this.eventBus_.subscribe("cart.created", this.log)
|
||||
this.eventBus_.subscribe("cart.updated", this.log)
|
||||
}
|
||||
|
||||
async log(c) {
|
||||
console.log(c)
|
||||
}
|
||||
}
|
||||
|
||||
export default CartSubscriber
|
||||
Reference in New Issue
Block a user