Skip to content

Commit e3c5272

Browse files
authored
Merge pull request #20 from JtotheThree/master
change use_ref to use_mut_ref to support Yew hook change
2 parents 8bbb5f9 + 05956d0 commit e3c5272

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yewdux-functional/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl<T: Store> StoreRef<T> {
2222
}
2323

2424
pub fn on_output(mut self, on_output: impl Fn(T::Output) + 'static) -> Self {
25-
self.output = Some(use_ref(move || {
25+
self.output = Some(use_mut_ref(move || {
2626
Dispatch::bridge(Default::default(), on_output.into())
2727
}));
2828
self
@@ -64,7 +64,7 @@ pub fn use_store<T: Store>() -> StoreRef<T> {
6464
let dispatch = {
6565
let state = state.clone();
6666
// persist the Dispatch across renders
67-
use_ref(move || {
67+
use_mut_ref(move || {
6868
let on_state = Callback::from(move |new_state| {
6969
state.set(Some(new_state));
7070
});

0 commit comments

Comments
 (0)