pub async fn wait_for_component<T>(
    entity: EntityId,
    component: Component<T>
) -> Option<T>
where T: SupportedValue,
Expand description

Waits until id has the component. If the entity was deleted, the method returns None.

As the entity may have been despawned, you must handle the return value and not assume that the entity exists.