mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
23 lines
518 B
JavaScript
23 lines
518 B
JavaScript
import { module } from 'modujs';
|
||
import modularLoad from 'modularload';
|
||
|
||
export default class extends module {
|
||
constructor(m) {
|
||
super(m);
|
||
}
|
||
|
||
init() {
|
||
const load = new modularLoad({
|
||
enterDelay: 0
|
||
});
|
||
|
||
load.on('loaded', (transition, oldContainer, newContainer) => {
|
||
this.call('destroy', oldContainer, 'app');
|
||
})
|
||
|
||
load.on('ready', (transition, newContainer) => {
|
||
this.call('update', newContainer, 'app');
|
||
})
|
||
}
|
||
}
|