chain: reorder stuff
@@ -7,6 +7,11 @@ use super::actions::Action;
// to pass the action along the chain and give the handler an ability to emit new actions from that point of the chain onward
use std::rc::Rc;
pub type DispatcherFn = Box<Fn(&Action)>;
+
+pub trait Handler {
+ fn handle(&self, action: &Action, emit: Rc<DispatcherFn>);
+}
+
pub struct Chain {
dispatcher: DispatcherFn,
}
@@ -31,7 +36,3 @@ impl Chain {
(self.dispatcher)(action);
}
}
-
-pub trait Handler {
- fn handle(&self, action: &Action, emit: Rc<DispatcherFn>);
-}
