aboutsummaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
Diffstat (limited to 'demo')
-rw-r--r--demo/src/utils/editor-history.util.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/demo/src/utils/editor-history.util.ts b/demo/src/utils/editor-history.util.ts
index 65ca38a..023a698 100644
--- a/demo/src/utils/editor-history.util.ts
+++ b/demo/src/utils/editor-history.util.ts
@@ -1,20 +1,26 @@
const AVRJS8_EDITOR_HISTORY = 'AVRJS8_EDITOR_HISTORY';
export class EditorHistoryUtil {
- static hasLocalStorage: boolean = !!window.localStorage;
+ static hasLocalStorage = !!window.localStorage;
static storeSnippet(codeSnippet: string) {
- if (!EditorHistoryUtil.hasLocalStorage) return;
+ if (!EditorHistoryUtil.hasLocalStorage) {
+ return;
+ }
window.localStorage.setItem(AVRJS8_EDITOR_HISTORY, codeSnippet);
}
static clearSnippet() {
- if (!EditorHistoryUtil.hasLocalStorage) return;
+ if (!EditorHistoryUtil.hasLocalStorage) {
+ return;
+ }
localStorage.removeItem(AVRJS8_EDITOR_HISTORY);
}
static getValue() {
- if (!EditorHistoryUtil.hasLocalStorage) return;
+ if (!EditorHistoryUtil.hasLocalStorage) {
+ return;
+ }
return localStorage.getItem(AVRJS8_EDITOR_HISTORY);
}
}