daydream

A small matrix web client written in rust
git clone git://archive.git.mtrnord.blog/daydream-mx/daydream.git
Log | Files | Refs | README | LICENSE

native_worker.rs (587B)


      1 #![recursion_limit = "1024"]
      2 //====== Running the worker ======///
      3 
      4 // We need to import the Threaded trait to register the worker
      5 use log::*;
      6 use yew::agent::Threaded;
      7 
      8 /// This gets called by the worker.js entrypoint
      9 /// We need to wrap it in wasm_bindgen so the worker knows the spin the the yew worker instance
     10 fn main() {
     11     wasm_logger::init(wasm_logger::Config::default());
     12 
     13     // Spawning a yew component without StartApp requires initializing
     14     yew::initialize();
     15     info!("Worker");
     16 
     17     // ... registering the worker
     18     daydream::app::matrix::MatrixAgent::register();
     19 }