requireStoreRefScope function

  1. @visibleForTesting
LevitScope requireStoreRefScope(
  1. LevitScope? scope
)

Returns scope or throws when a LevitRef is used before scope attachment.

Implementation

@visibleForTesting
LevitScope requireStoreRefScope(LevitScope? scope) {
  if (scope == null) {
    throw StateError(
      'Store ref has no owning scope. Resolve the store via Levit.put/find '
      'or LevitStore.findIn before using LevitRef APIs.',
    );
  }
  return scope;
}