(sigil browser local-storage)
(sigil browser local-storage) - Browser localStorage facade.
None of these raise: the JavaScript side catches every exception the storage API can throw (a quota error, a sandboxed page with storage disabled, no localStorage at all) and reports it as #f, so a caller decides what a missing or unwritable value means. Under a non-browser build every procedure answers #f too.
Exports
local-storage-getprocedureRead the string stored under KEY, or #f when there is none.
raises: never; a missing key, a blocked storage API and a non-browser target all answer #f.
(local-storage-get "save") ; => "(board ...)" or #flocal-storage-set!procedureStore VALUE (a string) under KEY. Returns #t when stored.
raises: never; #f means the write did not happen (quota, a blocked storage API, a non-browser target).
(local-storage-set! "save" "(board ...)") ; => #tlocal-storage-remove!procedureRemove KEY. Returns #t when the storage API accepted the call, whether or not the key existed.
raises: never; #f means storage is unavailable.
(local-storage-remove! "save") ; => #t