webworld888/resources/assets/core/plugin.js
2021-10-26 19:14:12 +09:00

28 lines
474 B
JavaScript
Vendored

import * as $$ from 'xe/utils'
const symbolBooted = Symbol('booted')
export default class Plugin {
constructor () {
$$.eventify(this)
this[symbolBooted] = false
}
boot (XE, App) {
return new Promise((resolve) => {
if (this[symbolBooted]) {
resolve(this)
} else {
this.$$xe = XE
this.$$app = App
}
resolve(this)
this[symbolBooted] = true
})
}
booted () {
return this[symbolBooted]
}
}