Defined in: packages/db/src/local-storage.ts:156
LocalStorage collection utilities type
[key: string]: anyacceptMutations: (transaction) => Promise<void>;Defined in: packages/db/src/local-storage.ts:179
Accepts this Collection's manual mutations in write order and persists them to localStorage. Call it inside the transaction's mutationFn. The transaction's persistence receipt waits for this work even if the caller does not await the returned Promise. Await it when later mutationFn work depends on the storage write.
The transaction containing mutations to accept
PendingMutation<Record<string, unknown>, OperationType, Collection<Record<string, unknown>, any, any, any, any>>[]
Promise<void>
const localSettings = createCollection(localStorageCollectionOptions({...}))
const tx = createTransaction({
mutationFn: async ({ transaction }) => {
// Make API call first
await api.save(...)
// Then persist local-storage mutations after success
await localSettings.utils.acceptMutations(transaction)
}
})clearStorage: ClearStorageFn;Defined in: packages/db/src/local-storage.ts:157
getStorageSize: GetStorageSizeFn;Defined in: packages/db/src/local-storage.ts:158