Skip to content

alma-oss/fable-storage

Repository files navigation

Fable.Storage

NuGet NuGet Downloads Tests

Fable library for a working with Browser storages.


Install

Add following into paket.references

Alma.Fable.Storage

Usage

Simple string

open Alma.Fable.Storage

// Saving data to the storage
"data" |> LocalStorage.save "key"

// Loading data from the storage
let data = "key" |> LocalStorage.load<string>
let data = "key" |> LocalStorage.loadWith Decoder.forString

Complex object

open Alma.Fable.Storage

type Username = Username of string

type User = {
    Username: Username
    Name: string
}

// Saving data to the storage
{
    Username = Username "admin"
    Name = "admin"
}
|> LocalStorage.save "user"

// Loading data from the storage
let user = "user" |> LocalStorage.loadWith Decoder.forData<User>
let user = "user" |> LocalStorage.load<User>

Release

  1. Increment version in Alma.Fable.Storage.fsproj
  2. Update CHANGELOG.md
  3. Commit new version and tag it

Development

Requirements

Build

./build.sh build

Tests

./build.sh -t tests

About

Fable library for a working with Browser storages.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors