Skip to content

Classic API: App

Hayun Lee edited this page Dec 21, 2020 · 3 revisions

Parent Document: ANT APIs

App API is the set of APIs for managing application's life-cycle states.

You need to load app API module before you use its API as following.

var appApi = require(process.env.ANT_BIN_DIR + 'ant').app();

onLaunch()

onTermination()

void onTermination(Function onTerminationCallback())

onTermination() registers given onTerminationCallback, which will be called when application termination event comes.

onTerminationCallback contains jobs that should be done before the application is terminated.

Example

var appApi = require('app-api');
appApi.onTermination(function () {
  console.log("This function is called before this app is terminated.");
});

appReady()