You can register callbacks with RouteService::register_callback(), the docs aren't clear, but reading the code it appears that it may only be possible to register a single callback. gloo_events::EventListener documentation seems to suggest that when registering a second callback and replacing RouteService::event_listener and the previous EventListener is dropped, it will drop the callback in the browser.
It would be nice to be able to register multiple callbacks, and have the ability to de-register them too.
At the very least it would be good to improve the documentation for the current behavior.
You can register callbacks with
RouteService::register_callback(), the docs aren't clear, but reading the code it appears that it may only be possible to register a single callback.gloo_events::EventListenerdocumentation seems to suggest that when registering a second callback and replacingRouteService::event_listenerand the previousEventListeneris dropped, it will drop the callback in the browser.It would be nice to be able to register multiple callbacks, and have the ability to de-register them too.
At the very least it would be good to improve the documentation for the current behavior.