Skip to content

Commit

Permalink
feat: add del to storage
Browse files Browse the repository at this point in the history
  • Loading branch information
mt-max committed Nov 12, 2020
1 parent c68d223 commit c5f2bda
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ export function set(key: string, value: string): void {
sessionStorage.setItem(STORE_KEY, JSON.stringify(data));
}

export function del(key: string): void {
const data = getStorageObject();
delete data[key];

sessionStorage.setItem(STORE_KEY, JSON.stringify(data));
}

export default {
set,
get,
del,
};

0 comments on commit c5f2bda

Please sign in to comment.