3 Matching Annotations
  1. Dec 2020
    1. class Session extends Map { set(id, value) { if (typeof value === 'object') value = JSON.stringify(value); sessionStorage.setItem(id, value); } get(id) { const value = sessionStorage.getItem(id); try { return JSON.parse(value); } catch (e) { return value; } } }
    2. I think that the webStorage is one of the most exciting improvement of the new web. But save only strings in the value key-map I think is a limitation.