duid_core/core/mod.rs
1pub mod apps;
2pub mod duid_events;
3pub mod events;
4pub mod html;
5pub mod svg;
6pub(crate) mod v_node;
7pub mod util;
8
9use std::cell::Cell;
10use std::collections::HashMap;
11use wasm_bindgen::closure::Closure;
12
13
14thread_local!(static NODE_ID_COUNTER: Cell<usize> = Cell::new(1));
15
16/*
17pub(crate) fn create_unique_identifier() -> usize {
18 let id = NODE_ID_COUNTER.with(|x| {
19 let tmp = x.get();
20 x.set(tmp + 1);
21 tmp
22 });
23 id
24}
25*/
26/*
27pub(crate) fn clean_unique_identifier() {
28 NODE_ID_COUNTER.with(|x| {
29 x.set(1);
30 });
31}
32*/
33/*
34pub(crate) fn set_unique_identifier(id: usize) {
35 NODE_ID_COUNTER.with(|x| {
36 x.set(id);
37 });
38}
39*/
40
41pub(crate) type ActiveClosure = HashMap<usize, Vec<(&'static str, Closure<dyn FnMut(web_sys::Event)>)>>;
42pub(crate) const DATA_VDOM_ID: &str = "dom-event-id";