class AppContext
A singleton class that represents the global application state.
class AppContext extends ObservableObject;
Description
An instance of this class is available as app during the entire lifecycle of the application. Use that to access all properties and methods of AppContext, e.g. app.log and app.addActivity(...).
Static members
AppContext.getInstance() static
Returns the current application context.AppContext.setErrorHandler() static
Sets a global unhandled error handler.
Instance members
activities readonly
The root activity router.log readonly
The global message log writer instance, an instance of LogWriter.i18n readonly
The current i18n context, an instance of I18nContext.queue readonly
The global task queue, an instance of AppQueue.renderer
The current application output renderer, an instance of RenderContext.viewport
Current viewport information, an object of type Viewport.navigation
The current navigation context, an instance of NavigationContext.clear()
Clears the state of the global application context.schedule()
Schedules a task on the global queue.addActivity()
Adds an activity to the application.addRoutes()
Registers route patterns with activities or factory functions.navigate()
Navigates to the specified path asynchronously.goBack()
Navigates back to the previous location in the history stack.render()
Renders the provided view using specified placement options.showAlertDialogAsync()
Displays an alert dialog with the specified content and a single dismiss button.showConfirmDialogAsync()
Displays a confirmation dialog with the specified text and buttons.showModalMenuAsync()
Displays a context/dropdown menu with the provided list of items.remount()
Re-renders output, and relocates existing mounted view output if needed.
Inherited members
emit()
Emits an event, immediately calling all event handlers.emitChange()
Emits a change event.listen()
Adds a handler for all events emitted by this object.listenOnce()
Returns a promise for a single event with the provided name.listenAsync()
Adds a handler for all events emitted by this object, and returns an async iterable.observe()
Observes a property, a bound property from an attached parent, or an observable object.observeAsync()
Observes one or more targets asynchronously, batching or debouncing/throttling updates.attach() protected
Attaches the specified observable object to this object.isUnlinked()
Returns true if the object has been unlinked.unlink()
Unlinks this observable object.beforeUnlink() protected
A method that’s called immediately before unlinking an object, can be overridden.
