|
@@ -1,10 +1,7 @@
|
|
|
import { domReady } from './utils'
|
|
|
import { createObservable } from './observable'
|
|
|
-import EventBus from './bus'
|
|
|
|
|
|
const Spruce = {
|
|
|
- events: EventBus,
|
|
|
-
|
|
|
stores: {},
|
|
|
|
|
|
subscribers: [],
|
|
@@ -65,26 +62,6 @@ const Spruce = {
|
|
|
this.subscribers.filter(el => !! el.__x).forEach(el => {
|
|
|
el.__x.updateElements(el)
|
|
|
})
|
|
|
- },
|
|
|
-
|
|
|
- on(name, callback) {
|
|
|
- return this.events.on(name, callback)
|
|
|
- },
|
|
|
-
|
|
|
- once(name, callback) {
|
|
|
- return this.events.once(name, callback)
|
|
|
- },
|
|
|
-
|
|
|
- off(name, callback) {
|
|
|
- this.events.off(name, callback)
|
|
|
- },
|
|
|
-
|
|
|
- emit(name, data = {}) {
|
|
|
- this.events.emit(name, { ...data, store: this.stores })
|
|
|
- },
|
|
|
-
|
|
|
- watch(dotNotation, callback) {
|
|
|
- this.events.watch(dotNotation, callback)
|
|
|
}
|
|
|
}
|
|
|
|