nw-skeleton

Class: App

app. App

App class - main class for nw-skeleton based app instances This class has three methods that are important for application life cycle:
  • initialize
  • finalize
  • shutdown
All three methods are async, and called from nw-skeleton appWrapper automatically.

Initialize is called first and it loads application helpers, sets application basic data, and finally loads eventual subFiles from configuration, instantiate their classes and (await) call initialize methods on all classes that contain that method.

Finalize is called once both backend and frontend app have been initialized, and it has complete app structure and appState at its disposal. It will also automatically (await) call 'finalize' method on all sub classes that have it.

Shutdown is called before application window is closed or unloaded and should perform all necessary cleanup operations, remove any event listeners and free any remaining references left over from application usage. This method will also (await) call 'shutdown' method on any sub classes that have that method.

Extends

  • WrapperApp

Methods

finalize(){boolean}

Return

Finalizes app and its subfiles. This method is called once frontend application is created, so code here has all references that are available to the application

initialize(){App}

Return

Initializes app and its dependencies

localRequire(moduleName){Object}

Parameters

Name Type Description
moduleName string Name of module to require

Return

Local require for loading app modules from appWrapper

setMainView(menuItem){undefined}

Parameters

Name Type Description
menuItem Object Menuitem that triggered the handler

Return

Handler for menu item that sets subcomponent view

shutdown(){boolean}

Return

Shuts down application and all its dependencies, freeing memory, removing references and preparing for app exit