Delete a record from object store
item's key
Delete record with key task one
await Todo.delete('task one')
Retrieves an array of a given object's own enumerable string-keyed property [key, value]
pairs
value's type
an array of a given object's own enumerable string-keyed property [key, value]
pairs
await Todo.entries()
Get a record from object store
value's type
item's key
Recorded value
Get record with key task one
await Todo.get('task one')
Iterate over all the record in an object store and perform an async action on each one
async callback returns type
async callback(action)
A list contains async action results
Delete all completed task :
await Todo.iterate(([key, value], index, entries) => {
if (value.completed) return Todo.delete(key);
})
Retrieves the keys of records in an object store
A list containing all object store keys
await Todo.keys()
Put a record in the object store Replaces items with the same keys
value's type
item's value
item's key when no option (keyPath or autoIncrement) specified this argument is required
Recorded value
Using id
as objectStore keyPath option :
await Todo.put({ id: 1, content: 'Pet my cat' })
Using autoIncrement option :
await Todo.put({ content: 'Pet my cat' })
No option (keyPath or autoIncrement) provided :
await Todo.put({ content: 'Pet my cat' }, 'task one')
Retrieves the values of records in an object store
value's type
An list containing all object store values
await Todo.values()
Generated using TypeDoc
Delete all records stored in an object store
await Todo.clear()