Skip to main content

Function: useDeleteGame()

useDeleteGame(): (slot) => Promise<SaveResult>

Defined in: packages/core/src/saves/hooks/useDeleteGame.ts:24

React hook that provides a function to delete the save in a slot. Removes the save from IndexedDB storage.

Returns​

Function that accepts a slot and deletes the save it holds

(slot): Promise<SaveResult>

Parameters​

slot​

string | number

Returns​

Promise<SaveResult>

Example​

const deleteGame = useDeleteGame();
const handleDelete = async () => {
const result = await deleteGame(slotIndex);
if (!result.success) {
console.error('Delete failed:', result.error);
}
};