Notify global observers when removing a global

This commit is contained in:
Max Brunsfeld 2024-01-15 17:02:20 -08:00
parent 8f1633e798
commit 1e755aa00f

View file

@ -843,6 +843,7 @@ impl AppContext {
/// Remove the global of the given type from the app context. Does not notify global observers.
pub fn remove_global<G: Any>(&mut self) -> G {
let global_type = TypeId::of::<G>();
self.push_effect(Effect::NotifyGlobalObservers { global_type });
*self
.globals_by_type
.remove(&global_type)