Skip to main content

onExit

@totemsdk/pear


@totemsdk/pear / onExit

Function: onExit()

onExit(cb): Unsubscribe

Register a cleanup callback to be called on app shutdown. Callbacks are called in LIFO (last-in-first-out) order so that higher-level clients are torn down before lower-level transports.

Returns an unsubscribe function that removes the callback.

Parameters

cb

ExitCallback

Returns

Unsubscribe