import GHCJS.DOM (currentWindowUnchecked)
import GHCJS.DOM.Window (getLocalStorage)
import Reflex.Dom.Core
import Tapaw.Storage.KV (StoreKey, getKVAll, putKV, runKVStoreTStorage)

main :: IO ()
main = run 3000 $ mainWidget $ do
  storage <- getLocalStorage =<< currentWindowUnchecked
  runKVStoreTStorage @User storage "users" $ do
    eIns <- button "Insert"
    eDel <- button "Delete"
    putKV ((UserId 5, Just User) <$ eIns)