Registers an event listener for a specific event name.
The name of the event to listen for (must be a key in E).
The function to be called when the event is fired.
If true, the listener will be added to the beginning of the listener list (capturing phase).
Dispatches an event with a given name and payload to all registered listeners.
The name of the event to fire (must be a key in E).
The event payload (event object) to pass to the listeners.
Registers a route handler for the given URI pattern.
A path string (may include parameter placeholders) or a RegExp used to match request URIs.
A function conforming to the RouteHandler type that will be executed when a request matches the route.
void
Navigate to a given URI within the router, update browser history, and optionally notify route handlers.
Normalizes the supplied URI updates the browser history and emits lifecycle events.
Behavior summary:
Target URI to navigate to. If it does not start with '/', a leading '/' will be added. When m_useHash is true the resulting location will be converted to a '#...' fragment.
Whether to invoke the matched route handler after updating history. Defaults to true.
Whether to replace the current history entry (true) or push a new one (false). Defaults to false.
True if navigation succeeded (route found and history updated); false if no route or handlers were found.
Removes a previously registered event listener.
The name of the event from which to remove the listener.
The specific callback function to remove. It must be the same function instance that was originally registered.
micro router