Open History to see the last commit
1---
2id: clear
3title: clear
4---
5
6```ts
7function clear(objectStore): Promise<void>;
8```
9
10Defined in: packages/db/src/indexed-db-wrapper.ts:481
11
12Removes all items from an object store.
13
14## Parameters
15
16### objectStore
17
18`IDBObjectStore`
19
20The IDBObjectStore to clear
21
22## Returns
23
24`Promise`\<`void`\>
25
26A promise that resolves when all items are removed
27
28## Example
29
30```typescript
31await executeTransaction(db, 'todos', 'readwrite', async (tx, stores) => {
32 await clear(stores.todos)
33 console.log('All todos cleared')
34})
35```