Skip to main content

loader_script

Function loader_script 

Source
pub fn loader_script(
    wasm_js_url: &str,
    wasm_url: &str,
    mount_selector: &str,
    ws_url: &str,
) -> String
Expand description

Generate a <script> tag that loads hotmeal-wasm and starts live-reload.

Arguments:

  • wasm_js_url: URL to the generated hotmeal_wasm.js glue code
  • wasm_url: URL to the .wasm binary
  • mount_selector: CSS selector for the mount point element (e.g. "body" or "#content")
  • ws_url: WebSocket URL for live-reload connection (e.g. "ws://localhost:3000/_lr")