Introduce weak_handle methods on ModelContext and ViewContext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
29b616f4cc
commit
4cc1556ca4
7 changed files with 21 additions and 13 deletions
|
@ -272,7 +272,7 @@ impl Client {
|
|||
let subscription_id = (TypeId::of::<T>(), Default::default());
|
||||
let client = self.clone();
|
||||
let mut state = self.state.write();
|
||||
let model = cx.handle().downgrade();
|
||||
let model = cx.weak_handle();
|
||||
let prev_extractor = state
|
||||
.entity_id_extractors
|
||||
.insert(subscription_id.0, Box::new(|_| Default::default()));
|
||||
|
@ -317,7 +317,7 @@ impl Client {
|
|||
let subscription_id = (TypeId::of::<T>(), remote_id);
|
||||
let client = self.clone();
|
||||
let mut state = self.state.write();
|
||||
let model = cx.handle().downgrade();
|
||||
let model = cx.weak_handle();
|
||||
state
|
||||
.entity_id_extractors
|
||||
.entry(subscription_id.0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue