Guest User

Untitled

a guest
Aug 26th, 2019
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var storage = (function (log) {
  2.  
  3.  
  4. var remove = function (key) {
  5.  
  6. log.debug({ class: 'localStorage', method: 'remove', key: key });
  7.  
  8. window.localStorage.removeItem(key);
  9. };
  10.  
  11. var get = function (key) {
  12.  
  13. log.debug({ class: 'localStorage', method: 'get', key: key });
  14.  
  15. return window.localStorage.getItem(key);
  16. };
  17.  
  18. var set = function (key, value) {
  19.  
  20. log.debug({ class: 'localStorage', method: 'set', key: key, value: value });
  21.  
  22. window.localStorage.setItem(key, value);
  23. };
  24.  
  25. var clear = function () {
  26.  
  27. log.debug({ class: 'localStorage', method: 'clear' });
  28.  
  29. window.localStorage.clear();
  30.  
  31. };
  32.  
  33.  
  34. return {
  35. get: get,
  36. remove: remove,
  37. set: set,
  38. clear: clear
  39. };
  40.  
  41. })(log);
RAW Paste Data