orbit<T extends OrbitStore> method

T orbit<T extends OrbitStore>([
  1. OrbitStoreRef<T>? storeRef
])

Accesses store T from the nearest OrbitScope<T>, falling back to the global singleton if a storeRef is provided, and subscribes this widget context to rebuild on changes.

Implementation

T orbit<T extends OrbitStore>([OrbitStoreRef<T>? storeRef]) {
  if (storeRef != null) {
    return storeRef.of(this, listen: true);
  }
  return OrbitScope.of<T>(this, listen: true);
}