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
12d6ddef16
commit
5ed98bfd9d
10 changed files with 252 additions and 25 deletions
|
@ -197,6 +197,11 @@ pub trait AppContext {
|
|||
where
|
||||
T: 'static;
|
||||
|
||||
/// Update a entity in the app context.
|
||||
fn as_mut<'a, T>(&'a mut self, handle: &Entity<T>) -> Self::Result<GpuiBorrow<'a, T>>
|
||||
where
|
||||
T: 'static;
|
||||
|
||||
/// Read a entity from the app context.
|
||||
fn read_entity<T, R>(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue