registerDatastoreService function

void registerDatastoreService(
  1. Datastore datastore
)

Registers the Datastore object within the current service scope.

The provided datastore object will be available via the top-level datastore getter.

Calling this function outside of a service scope will result in an error. Calling this function more than once inside the same service scope is not allowed.

Implementation

void registerDatastoreService(Datastore datastore) {
  ss.register(_datastoreKey, datastore);
}