Less clumsy configuration for desktop and mobile (#553)

* chore: dont use prebuilt builder pattern for configuring desktop

* chore: use regular config pattern for web

* Chore: update docs too

* chore: clean up some warnings
This commit is contained in:
Jon Kelley authored and GitHub committed 2022-09-13 16:22:27 -07:00
1 parent 41b450eedf
commit 540e785d8b
28 files changed
+172 -156

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ use std::{any::Any, rc::Rc, sync::Arc};
use wasm_bindgen::{closure::Closure, JsCast};
use web_sys::{Document, Element, Event, HtmlElement};
use crate::WebConfig;
use crate::Config;
pub struct WebsysDom {
pub interpreter: Interpreter,
@@ -26,7 +26,7 @@ pub struct WebsysDom {
}
impl WebsysDom {
pub fn new(cfg: WebConfig, sender_callback: Rc<dyn Fn(SchedulerMsg)>) -> Self {
pub fn new(cfg: Config, sender_callback: Rc<dyn Fn(SchedulerMsg)>) -> Self {
// eventually, we just want to let the interpreter do all the work of decoding events into our event type
let callback: Box<dyn FnMut(&Event)> = Box::new(move |event: &web_sys::Event| {
let mut target = event