continuePrimaryKey method

void continuePrimaryKey(
  1. JSAny? key,
  2. JSAny? primaryKey
)

The continuePrimaryKey() method of the IDBCursor interface advances the cursor to the item whose key matches the key parameter as well as whose primary key matches the primary key parameter.

A typical use case, is to resume the iteration where a previous cursor has been closed, without having to compare the keys one by one.

Calling this method more than once before new cursor data has been loaded

  • for example, calling continuePrimaryKey() twice from the same onsuccess handler - results in an InvalidStateError being thrown on the second call because the cursor's got value flag has been unset.

This method is only valid for cursors coming from an index. Using it for cursors coming from an object store will throw an error.

Implementation

external void continuePrimaryKey(
  JSAny? key,
  JSAny? primaryKey,
);