-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: make global instance lazy load
- Loading branch information
1 parent
91e2a57
commit 58b016b
Showing
4 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,16 @@ export class BasicTool { | |
disableZLog: false, | ||
prefix: "", | ||
}, | ||
debug: ToolkitGlobal.getInstance()?.debugBridge || { | ||
disableDebugBridgePassword: false, | ||
password: "", | ||
// We will remove this in the future, for now just let it be lazy loaded. | ||
get debug() { | ||
if (this._debug) { | ||
return this._debug; | ||
} | ||
this._debug = ToolkitGlobal.getInstance()?.debugBridge || { | ||
disableDebugBridgePassword: false, | ||
password: "", | ||
}; | ||
return this._debug; | ||
}, | ||
api: { | ||
pluginID: "[email protected]", | ||
|
@@ -451,6 +458,7 @@ export interface BasicOptions { | |
disableDebugBridgePassword: boolean; | ||
password: string; | ||
}; | ||
_debug?: BasicOptions["debug"]; | ||
api: { | ||
pluginID: string; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters