Skip to content
Snippets Groups Projects
Select Git revision
  • 68853bd44ccd721637c0dd47caf7764c36954e50
  • 3.0 default protected
  • 2.0
  • mamarley-autocomplete
  • master protected
5 results

message.js

  • storage.js 335 B
    class Storage {
        static get(key) {
            try {
                return JSON.parse(localStorage.getItem(key));
            } catch (e) {
                return null;
            }
        }
    
        static set(key, value) {
            localStorage.setItem(key, JSON.stringify(value));
        }
    
        static exists(key) {
            return !!Storage.get(key);
        }
    }