Skip to content

Instantly share code, notes, and snippets.

View bzg's full-sized avatar
🎯
Focusing

Bastien bzg

🎯
Focusing
View GitHub Profile
@bzg
bzg / localstorage.cljs
Created October 24, 2019 20:20 — forked from daveliepmann/localstorage.cljs
HTML5 localStorage utility functions for ClojureScript. I find it makes for cleaner code when I wrap the native JS.
(ns localstorage)
(defn set-item!
"Set `key' in browser's localStorage to `val`."
[key val]
(.setItem (.-localStorage js/window) key val))
(defn get-item
"Returns value of `key' from browser's localStorage."
[key]