forked from docsifyjs/docsify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (21 loc) 路 642 Bytes
/
Copy pathindex.js
File metadata and controls
24 lines (21 loc) 路 642 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import config from '../config';
/**
* This class is responsible to initializing all other mixins in a certain
* order, and calling lifecycle hooks at appropriate times.
*/
export function initMixin(Base = class {}) {
return class extends Base {
constructor() {
super();
this.config = config(this);
this.initLifecycle(); // Init hooks
this.initPlugin(); // Install plugins
this.callHook('init');
this.initRouter(); // Add router
this.initRender(); // Render base DOM
this.initEvent(); // Bind events
this.initFetch(); // Fetch data
this.callHook('mounted');
}
};
}