Fable.LitStore.Unofficial
2.19.0
dotnet add package Fable.LitStore.Unofficial --version 2.19.0
NuGet\Install-Package Fable.LitStore.Unofficial -Version 2.19.0
<PackageReference Include="Fable.LitStore.Unofficial" Version="2.19.0" />
<PackageVersion Include="Fable.LitStore.Unofficial" Version="2.19.0" />
<PackageReference Include="Fable.LitStore.Unofficial" />
paket add Fable.LitStore.Unofficial --version 2.19.0
#r "nuget: Fable.LitStore.Unofficial, 2.19.0"
#:package Fable.LitStore.Unofficial@2.19.0
#addin nuget:?package=Fable.LitStore.Unofficial&version=2.19.0
#tool nuget:?package=Fable.LitStore.Unofficial&version=2.19.0
Fable.LitStore.Unofficial
Read a Fable.Store from a Fable.Lit component.
dotnet add package Fable.LitStore.Unofficial
open Lit
open LitStore
[<HookComponent>]
let ThemeBadge () =
let theme = Hook.useStore Theme.store
html $"""<span>{Theme.name theme}</span>"""
The subscription is taken in the component's initialiser, so the first render already has the store's value, and is disposed when the component disconnects. An element that is moved rather than removed resubscribes and catches up on what changed while it was out of the document.
Writing is not a hook: dispatch from Store.makeElmish, or store.Update, is the same
function for every caller and has nothing per-component about it.
Worth knowing before a component is a store's only reader: Fable.Store disposes a store when its last subscriber leaves. A store meant to outlive its readers needs something else holding a subscription — for a page-level concern, one taken where the app starts.
Why this exists
The original Fable.LitStore depends on
upstream Fable.Lit, and both live in the Lit namespace, so it cannot be referenced
alongside this fork. The implementation here is written fresh against the same signature,
Hook.useStore store, so moving between the two is a package reference and nothing else.
Fable.Store has only ever published prereleases, so this package carries a prerelease
dependency (NuGet warns NU5104). Restore handles it; nothing else is required of you.
Why "Unofficial"
This is a republished build of Fable.Lit by Alfonso García-Caro Núñez and its contributors, packaged from a fork so that fixes can be used before they land upstream. The toolchain is .NET 10, Fable 5, Fable.Core 4 and lit 3.
Reference this or upstream Fable.Lit, never both: they share the Lit namespace.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Fable.Lit.Unofficial (>= 2.19.0)
- Fable.Store (>= 1.0.0-beta-005)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Unofficial fork of Fable.Lit. Toolchain moved to .NET 10, Fable 5, Fable.Core 4 and lit 3; event handlers no longer raise FS3884. See the repository for what differs from upstream.