Allow subscription/notification to be cancelled by dropping the returned Subscription
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
f4847bd38f
commit
6df80d94ad
8 changed files with 228 additions and 110 deletions
|
@ -190,7 +190,8 @@ impl<T: Entity> Observer<T> {
|
|||
let observer = cx.add_model(|cx| {
|
||||
cx.observe(handle, move |_, _, _| {
|
||||
let _ = notify_tx.try_send(());
|
||||
});
|
||||
})
|
||||
.detach();
|
||||
Observer(PhantomData)
|
||||
});
|
||||
(observer, notify_rx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue