ensureObject<T> method

ObjectComponentStore<T> ensureObject<T>()

Returns the object store for T, creating it with one map lookup when absent.

Implementation

ObjectComponentStore<T> ensureObject<T>() {
  final existing = _stores[T];
  if (existing != null) return existing as ObjectComponentStore<T>;
  final created = ObjectComponentStore<T>();
  _add(T, created);
  return created;
}