diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index 93d4c8b10..80de92917 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -357,12 +357,14 @@ pub struct EventHandler<'bump, T = ()> { } impl EventHandler<'_, T> { + /// Call this event handler with the appropriate event type pub fn call(&self, event: T) { if let Some(callback) = self.callback.borrow_mut().as_mut() { callback(event); } } + /// Forcibly drop the internal handler callback, releasing memory pub fn release(&self) { self.callback.replace(None); }