pinafore/routes/_components/dialog/helpers/onCreateDialog.js

14 lines
232 B
JavaScript
Raw Normal View History

import { on } from '../../../_utils/eventBus'
function onDestroy (thisId) {
let { id } = this.get()
if (id !== thisId) {
return
}
this.destroy()
}
export function oncreate () {
on('destroyDialog', this, onDestroy)
}