Sha256: 6b31ad8a30f07e72b70dea10bfa92a93f06a48c89202caccc92405c945a753f6
Contents?: true
Size: 910 Bytes
Versions: 71
Compression:
Stored size: 910 Bytes
Contents
if RUBY_PLATFORM == 'opal' module Volt module LocalStorage def self.[](key) ` var val = localStorage.getItem(key); return val === null ? nil : val; ` end def self.[]=(key, value) `localStorage.setItem(key, value)` end def self.clear `localStorage.clear()` self end def self.delete(key) ` var val = localStorage.getItem(key); localStorage.removeItem(key); return val === null ? nil : val; ` end end end else module Volt module LocalStorage @@store = {} def self.[](key) @@store[key] end def self.[]=(key, value) @@store[key] = value end def self.clear @@store = {} self end def self.delete(key) @@store.delete(key) end end end end
Version data entries
71 entries across 71 versions & 1 rubygems