Constructors

Properties

configure: ((config?) => void)

Type declaration

delete: {
    <T>(modelConstructor, identifier): Promise<T[]>;
    <T>(modelConstructor, condition): Promise<T[]>;
    <T>(model, condition?): Promise<T>;
}

Type declaration

observe: {
    (): Observable<SubscriptionMessage<Readonly<Record<string, any>>>>;
    <T>(modelConstructor, identifier): Observable<SubscriptionMessage<T>>;
    <T>(modelConstructor, criteria?): Observable<SubscriptionMessage<T>>;
    <T>(model): Observable<SubscriptionMessage<T>>;
}

Type declaration

observeQuery: (<T>(modelConstructor, criteria?, paginationProducer?) => Observable<DataStoreSnapshot<T>>)

Type declaration

query: {
    <T>(modelConstructor, identifier): Promise<undefined | T>;
    <T>(modelConstructor, criteria?, paginationProducer?): Promise<T[]>;
}

Type declaration

save: (<T>(model, condition?) => Promise<T>)

Type declaration

setConflictHandler: ((config) => ConflictHandler)

Type declaration

setErrorHandler: ((config) => ErrorHandler)

Type declaration

start: (() => Promise<void>)

If not already done:

  1. Attaches and initializes storage.
  2. Loads the schema and records metadata.
  3. If this.amplifyConfig.aws_appsync_graphqlEndpoint contains a URL, attaches a sync engine, starts it, and subscribes.

Type declaration

    • (): Promise<void>
    • If not already done:

      1. Attaches and initializes storage.
      2. Loads the schema and records metadata.
      3. If this.amplifyConfig.aws_appsync_graphqlEndpoint contains a URL, attaches a sync engine, starts it, and subscribes.

      Returns Promise<void>

Methods

  • Clears all data from storage and removes all data, schema info, other initialization details, and then stops DataStore.

    That said, reinitialization is required after clearing. This can be done by explicitiliy calling start() or any method that implicitly starts DataStore, such as query(), save(), or delete().

    Returns Promise<void>

  • Returns string

  • Builds a function to capture BackgroundManagerNotOpenError's to produce friendlier, more instructive errors for customers.

    Parameters

    • operation: string

      The name of the operation (usually a Datastore method) the customer tried to call.

    Returns ((err) => never)

      • (err): never
      • Parameters

        Returns never

  • Stops all DataStore sync activities.

    TODO: "Waits for graceful termination of running queries and terminates subscriptions."

    Parameters

    Returns Promise<void>