Skip to content

Commit

Permalink
refactor: dispatchers no longer go through async scheduling to improv…
Browse files Browse the repository at this point in the history
…e reactivity (#60)
  • Loading branch information
sxyazi committed Aug 14, 2023
1 parent edd0ad7 commit 8fd3d15
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl App {
Event::Resize(..) => app.dispatch_resize(),
Event::Stop(state, tx) => app.dispatch_stop(state, tx),
Event::Ctrl(ctrl, layer) => app.dispatch_ctrl(ctrl, layer),
event => app.dispatch_module(event).await,
event => app.dispatch_module(event),
}
}
Ok(())
Expand Down Expand Up @@ -107,12 +107,14 @@ impl App {
}
}

async fn dispatch_module(&mut self, event: Event) {
fn dispatch_module(&mut self, event: Event) {
let manager = &mut self.cx.manager;
let tasks = &mut self.cx.tasks;
match event {
Event::Cd(path) => {
manager.active_mut().cd(absolute_path(path).await).await;
futures::executor::block_on(async {
manager.active_mut().cd(absolute_path(path).await).await;
});
}
Event::Refresh => {
manager.refresh();
Expand Down

0 comments on commit 8fd3d15

Please sign in to comment.