Add frontend file structure docs and some related cleanup

This commit is contained in:
Keavon Chambers 2022-05-23 19:13:51 -07:00
parent e4e37cca7b
commit d5b43ef2da
21 changed files with 168 additions and 145 deletions

View file

@ -1,7 +1,8 @@
pub mod api;
pub mod editor_api;
pub mod helpers;
use helpers::{panic_hook, WasmLog};
use std::cell::RefCell;
use std::collections::HashMap;
use std::panic;
@ -13,7 +14,7 @@ pub static EDITOR_HAS_CRASHED: AtomicBool = AtomicBool::new(false);
pub static LOGGER: WasmLog = WasmLog;
thread_local! {
pub static EDITOR_INSTANCES: RefCell<HashMap<u64, editor::Editor>> = RefCell::new(HashMap::new());
pub static JS_EDITOR_HANDLES: RefCell<HashMap<u64, api::JsEditorHandle>> = RefCell::new(HashMap::new());
pub static JS_EDITOR_HANDLES: RefCell<HashMap<u64, editor_api::JsEditorHandle>> = RefCell::new(HashMap::new());
}
/// Initialize the backend