Add the entity trait and implement for models, views, subscriptions, and observations

This commit is contained in:
Mikayla 2023-10-30 17:43:07 -07:00
parent 58446c2715
commit 327a2f9967
No known key found for this signature in database
13 changed files with 183 additions and 101 deletions

View file

@ -26,13 +26,13 @@ impl Context for TestAppContext {
lock.build_model(build_model)
}
fn update_entity<T: 'static, R>(
fn update_model<T: 'static, R>(
&mut self,
handle: &Model<T>,
update: impl FnOnce(&mut T, &mut Self::ModelContext<'_, T>) -> R,
) -> Self::Result<R> {
let mut lock = self.app.lock();
lock.update_entity(handle, update)
lock.update_model(handle, update)
}
}