#![allow(clippy::all, unused)] use std::rc::Rc; use dioxus_core::prelude::*; use crate::{AtomRoot, Readable, Writable}; #[derive(Clone)] pub struct CallbackApi { root: Rc, } impl CallbackApi { // get the current value of the atom pub fn get(&self, atom: impl Readable) -> &V { todo!() } // get the current value of the atom in its RC container pub fn get_rc(&self, atom: impl Readable) -> &Rc { todo!() } // set the current value of the atom pub fn set(&self, atom: impl Writable, value: V) { todo!() } } #[must_use] pub fn use_atom_context(cx: &ScopeState) -> &CallbackApi { todo!() } macro_rules! use_callback { (&$cx:ident, [$($cap:ident),*], move || $body:expr) => { move || { $( #[allow(unused_mut)] let mut $cap = $cap.to_owned(); )* $cx.spawn($body); } }; } #[macro_export] macro_rules! to_owned { ($($es:ident),+) => {$( #[allow(unused_mut)] let mut $es = $es.to_owned(); )*} }