Checkpoint

This commit is contained in:
Antonio Scandurra 2023-10-12 13:25:49 +02:00
parent 23f11fcd5e
commit 80c0a6ead3
6 changed files with 23 additions and 24 deletions

View file

@ -966,7 +966,9 @@ impl<'a, 'w, S: Send + Sync + 'static> ViewContext<'a, 'w, S> {
self.window_cx
.app
.pending_effects
.push_back(Effect::Notify(self.entity_id));
.push_back(Effect::Notify {
emitter: self.entity_id,
});
}
pub fn run_on_main<R>(
@ -1016,9 +1018,8 @@ impl<'a, 'w, S: Send + Sync + 'static> ViewContext<'a, 'w, S> {
impl<'a, 'w, S: EventEmitter + Send + Sync + 'static> ViewContext<'a, 'w, S> {
pub fn emit(&mut self, event: S::Event) {
let entity_id = self.entity_id;
self.app.pending_effects.push_back(Effect::Emit {
entity_id,
self.window_cx.app.pending_effects.push_back(Effect::Emit {
emitter: self.entity_id,
event: Box::new(event),
});
}