This repository has been archived on 2021-04-30. You can view files and clone it, but cannot push or open issues or pull requests.
blazing-workshop/BlazingPizza.ComponentsLibrary/wwwroot/localStorage.js

8 lines
275 B
JavaScript
Raw Normal View History

2020-12-17 15:52:43 +00:00
(function () {
window.blazorLocalStorage = {
get: key => key in localStorage ? JSON.parse(localStorage[key]) : null,
set: (key, value) => { localStorage[key] = JSON.stringify(value); },
delete: key => { delete localStorage[key]; }
};
})();