diff --git a/src/core/port.rs b/src/core/port.rs index 334941d..7ba8a25 100644 --- a/src/core/port.rs +++ b/src/core/port.rs @@ -111,15 +111,17 @@ impl OuterViewPort { self.get_view_arc() } -/* - pub fn add_reset_fn(&self, reset: impl Fn(Option>) + Send + Sync + 'static) -> Arc>>> { - self.add_observer(Arc::new(ResetFnObserver::new(reset))) + pub fn add_reset_fn>) + Send + Sync + 'static>(&self, reset: F) -> Arc>> { + let obs = Arc::new(RwLock::new(ResetFnObserver::new(reset))); + self.add_observer(obs.clone()); + obs } - pub fn add_notify_fn(&self, notify: impl Fn(&V::Msg) + Send + Sync + 'static) -> Arc>>> { - self.add_observer(Arc::new(NotifyFnObserver::new(notify))) + pub fn add_notify_fn(&self, notify: F) -> Arc>> { + let obs = Arc::new(RwLock::new(NotifyFnObserver::new(notify))); + self.add_observer(obs.clone()); + obs } -*/ } /*