gpui: Add use state APIs (#34741)
This PR adds a component level state API to GPUI, as well as a few utilities for simplified interactions with entities Release Notes: - N/A
This commit is contained in:
parent
4bdac8026c
commit
2da2ae65a0
10 changed files with 252 additions and 25 deletions
|
@ -726,6 +726,13 @@ impl<T> AppContext for Context<'_, T> {
|
|||
self.app.update_entity(handle, update)
|
||||
}
|
||||
|
||||
fn as_mut<'a, E>(&'a mut self, handle: &Entity<E>) -> Self::Result<super::GpuiBorrow<'a, E>>
|
||||
where
|
||||
E: 'static,
|
||||
{
|
||||
self.app.as_mut(handle)
|
||||
}
|
||||
|
||||
fn read_entity<U, R>(
|
||||
&self,
|
||||
handle: &Entity<U>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue