feat: change schedule_update's Rc to an Arc

BREAKING CHANGE
This commit is contained in:
Ilya Maximov committed 2022-02-23 19:47:17 +01:00
1 parent 03feaa446a
commit bda4a71a72
7 files changed
+19 -19

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ use dioxus_core::prelude::*;
use std::{
cell::{RefCell, RefMut},
fmt::{Debug, Display},
rc::Rc,
rc::Rc, sync::Arc,
};
/// Store state between component renders.
@@ -69,7 +69,7 @@ pub fn use_state<'a, T: 'static>(
pub struct UseState<T: 'static> {
pub(crate) current_val: Rc<T>,
pub(crate) update_callback: Rc<dyn Fn()>,
pub(crate) update_callback: Arc<dyn Fn()>,
pub(crate) setter: Rc<dyn Fn(T)>,
pub(crate) slot: Rc<RefCell<Rc<T>>>,
}