mirror of
https://github.com/frappe/books.git
synced 2025-02-03 12:38:34 +00:00
feat: allow force initialization
This commit is contained in:
parent
8da2332c74
commit
e0eeaad677
8
index.js
8
index.js
@ -2,8 +2,8 @@ const Observable = require('./utils/observable');
|
||||
const utils = require('./utils');
|
||||
|
||||
module.exports = {
|
||||
initializeAndRegister(customModels = {}) {
|
||||
this.init();
|
||||
initializeAndRegister(customModels = {}, force = false) {
|
||||
this.init(force);
|
||||
const common = require('frappejs/common');
|
||||
this.registerLibs(common);
|
||||
const coreModels = require('frappejs/models');
|
||||
@ -11,8 +11,8 @@ module.exports = {
|
||||
this.registerModels(customModels);
|
||||
},
|
||||
|
||||
init() {
|
||||
if (this._initialized) return;
|
||||
init(force) {
|
||||
if (this._initialized && !force) return;
|
||||
this.initConfig();
|
||||
this.initGlobals();
|
||||
this.docs = new Observable();
|
||||
|
Loading…
x
Reference in New Issue
Block a user