Understand the window.customJS global object
masterThe window.customJS object is available globally and holds instances of your loaded classes. It also contains special properties:
customJS.state: An object used to persist data. Sincewindow.customJSis overwritten whenever JS files are modified, you should store any data you want to keep incustomJS.state.customJS.obsidian: Access to the Obsidian API.customJS.app: The ObsidianAppinstance.
Class Properties:
For every class MyModule you define, CustomJS adds:
customJS.MyModule: The singleton instance of your class.customJS.createMyModuleInstance: A function to create a new instance (cannot pass arguments to the constructor).