Eliom_client.Page_statusSourcea page can be in one of the following states:
Generating: page is currently being generated and not yet instated as the active pageActive: page is currently being displayedCached: page is in the browser history with its DOM stashed in the cacheDead: page is in the browser history without its DOM being cachedretrieves a react signal for the status of the current page; note that the `current page' is not necessarily the page currently being displayed, but rather the page in whose context the current code is executed.
convenience functions for retrieving a react event for the current page that is triggered whenever it reaches the respective status
onactive is convenience function that attaches a handler to Events.active, which behaves exactly like fun f -> React.E.map f Events.active. If now is true (default) and the page is currently active the function is also invoked right away. This is useful to ensure that the function is invoked also on server-generated pages which are active right from the start and thus have no transition to the active state. If once is true (false by default) the action is executed only once. By stop one can supply an event that will deinstall the handler when triggered.
Typical use cases for this function are processes that need to run continually while a page is being viewed. Such processes (including event listeners of Dom_html.window) are killed on a page change and not automatically restored with the DOM (contrary to event listeners attached to DOM elements).