module Client.Utils

open Fable.Import

let load<'T> key =
    Browser.localStorage.getItem(key) |> unbox
    |> Option.map (JS.JSON.parse >> unbox<'T>)

let save key (data: 'T) =
    Browser.localStorage.setItem(key, JS.JSON.stringify data)

let delete key =
    Browser.localStorage.removeItem(key)
module Client.Utils

open Fable.Import
open Fable.Core.JsInterop

let inline load<'T> key =
    Browser.localStorage.getItem(key) |> unbox
    |> Option.map ofJson<'T>

let inline delete key =
    Browser.localStorage.removeItem(key)

let inline save<'T> key (data: 'T) =
    delete key
    Browser.localStorage.setItem(key, toJson data)

Use Fable serializer to handle DUs
Use Fable serializer to handle DUs