A type alias for the exception handler function.
Clear all message data associated with a message handler.
The message handler of interest.
This will clear all posted messages and hooks for the handler.
Process the pending posted messages in the queue immediately.
This function is useful when posted messages must be processed immediately, instead of on the next animation frame.
This function should normally not be needed, but it may be required to work around certain browser idiosyncrasies.
Recursing into this function is a no-op.
Get the message loop exception handler.
The current exception handler.
The default exception handler is console.error
.
Install a message hook for a message handler.
The message handler of interest.
The message hook to install.
A message hook is invoked before a message is delivered to the
handler. If the hook returns false
, no other hooks will be
invoked and the message will not be delivered to the handler.
The most recently installed message hook is executed first.
If the hook is already installed, this is a no-op.
Post a message to a message handler to process in the future.
The handler which should process the message.
The message to post to the handler.
The message will be conflated with the pending posted messages for the handler, if possible. If the message is not conflated, it will be queued for normal delivery on the next cycle of the event loop.
Exceptions in hooks and handlers will be caught and logged.
Remove an installed message hook for a message handler.
The message handler of interest.
The message hook to remove.
It is safe to call this function while the hook is executing.
If the hook is not installed, this is a no-op.
Send a message to a message handler to process immediately.
The handler which should process the message.
The message to deliver to the handler.
The message will first be sent through any installed message hooks
for the handler. If the message passes all hooks, it will then be
delivered to the processMessage
method of the handler.
The message will not be conflated with pending posted messages.
Exceptions in hooks and handlers will be caught and logged.
Set the message loop exception handler.
The function to use as the exception handler.
The old exception handler.
The exception handler is invoked when a message handler or a message hook throws an exception.
Generated using TypeDoc
The namespace for the global singleton message loop.