DeusSeuca / Stl.Fusion.Samples

Samples for Stl.Fusion: https://github.com/servicetitan/Stl.Fusion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to a collection of samples for Stl.Fusion!

All project updates are published on our Discord Server; it's also the best place for Q/A.
Build

Running Samples

The simplest way:

And if you'd rather run everything locally:

What's Inside?

1. Tutorial

It's interactive – you can simply browse it, but to modify and run the C# code presented there, you need Try .NET or Docker.

2. Blazor Samples

It's a dual-mode Blazor SPA hosted by ASP.NET Core website, which also serves its API. The application includes:

  • "Server Time" and "Server Screen" pages showing the simplest timeout-based invalidation
  • "Chat" - a tiny chat relying on event-based invalidation
  • "Composition" shows Fusion's ability to use both local IComputed<T> instances and client-side replicas of similar server-side instances to compute a new value that properly tracks both local and remote dependencies.

The app supports both (!) Server-Side Blazor and Blazor WebAssembly modes – you can switch the mode on "Home" page.

Moreover, it also exposes a regular RESTful API – try invoking any of endpoints there right from embedded Swagger console.

3. Hello World Sample

HelloWorld is a basic sample showing how to create a [ComputedServiceMethod] that depends on output of another method (i.e. how to create a dependency chain), invoke such methods from code, and react to changes in concurrent thread.

Check out its source code.

Useful Links

About

Samples for Stl.Fusion: https://github.com/servicetitan/Stl.Fusion

License:MIT License


Languages

Language:C# 74.8%Language:HTML 18.0%Language:CSS 4.5%Language:Dockerfile 1.3%Language:Batchfile 1.2%Language:JavaScript 0.2%