Skip to content

Commit

Permalink
create_signal_from_channel fix
Browse files Browse the repository at this point in the history
create_sginal_from_channel should
create the effect from the same cx
  • Loading branch information
dzhou121 committed Aug 6, 2023
1 parent 1cb2ebf commit 697e0ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions reactive/src/trigger.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::signal::{create_rw_signal, RwSignal};

#[derive(Debug)]
pub struct Trigger {
signal: RwSignal<()>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/ext_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn create_signal_from_channel<T: Send + 'static>(

{
let data = data.clone();
create_effect(move |_| {
cx.create_effect(move |_| {
trigger.track();
while let Some(value) = data.lock().pop_front() {
write.set(value);
Expand Down

0 comments on commit 697e0ae

Please sign in to comment.