The fifth counter sample targets SolidJS. The domain model and store are written in C#, while the generated TypeScript package exposes Solid-friendly state and interop wrappers.
Models/Counter.cs— immutable counter state withIncrementandDecrement.Stores/CounterStore.cs— store API that owns a Solid signal and exposes domain methods.JsInterop/SolidJs/— C# facades forcreateSignal,createEffect, raw Solid signals, and a wrapper that presents them asISignal<T>.
This sample is useful for generic interop wrappers, [Import], [NoContainer],
TypeScript-only [External], [Emit] templates, callbacks, and framework
state primitives.
The related TypeScript source is in targets/js/sample-counter-v5/src:
models/counter.tsstores/counter-store.tsjs-interop/solid-js/*.tsviews/app-view.tsxmain.tsx
The built JS package output is in targets/js/sample-counter-v5/lib.
dotnet build samples/SampleCounterV5/SampleCounterV5.csproj
cd targets/js/sample-counter-v5
bun install
bun run build