Function perseus::client::run_client

source ·
pub fn run_client<M: MutableStore, T: TranslationsManager>(
    app: impl Fn() -> PerseusAppBase<DomNode, M, T>
)
Expand description

The entrypoint into the app itself. This will be compiled to Wasm and actually executed, rendering the rest of the app. Runs the app in the browser on the client-side. This is designed to be executed in a function annotated with #[wasm_bindgen].

This is entirely engine-agnostic, using only the properties from the given PerseusApp.

For consistency with run_dflt_engine, this takes a function that returns the PerseusApp.

Note that, by the time this, or any of our code, is executing, the user can already see something due to engine-side rendering.

This function performs all error handling internally, and will do its level best not to fail, including through setting panic handlers.