Skip to content

Samples

Runnable applications:

github.com/Skymly/Observables.Samples

Run (NuGet, default)

Requires .NET 8 only — no sibling Observables clone.

powershell
git clone https://github.com/Skymly/Observables.Samples.git
cd Observables.Samples
dotnet run --project Observables.Samples.Events
dotnet run --project Observables.Samples.Events.Reactive
dotnet run --project Observables.Samples.RestAPI
dotnet run --project Observables.Samples.RestAPI.Reactive
dotnet run --project Observables.Samples.SignalR
dotnet run --project Observables.Samples.Mqtt

# Avalonia routed events (desktop only; not run in CI)
dotnet run --project Observables.Samples.Events.Routed

CI uses Nuke ./build.cmd Ci (console samples only). Default NuGet version 0.1.0-preview4 (Events, RestAPI, SignalR, Mqtt).

Projects

SampleDemonstrates
Observables.Samples.EventsEvents(), EventHandlers(), multiple subscribers on one stream
Observables.Samples.Events.ReactiveIObservable from classic events
Observables.Samples.Events.RoutedAvalonia AttachedRoutedEvent + <ObservableRoutedEvents>
Observables.Samples.RestAPITask / Observable<T>, list GET, ApiException with MockHttp
Observables.Samples.RestAPI.ReactiveIObservable<T> + FirstAsync().ToTask(), 404 handling
Observables.Samples.SignalR[Hub] interface, HubService.For factory registration (CI skips live hub)
Observables.Samples.Mqtt[Mqtt] topic proxy, MqttService.For factory registration (CI skips live broker)

Local generator development

When ../Observables/Observables.slnx exists:

powershell
dotnet build -p:UseLocalObservables=true
dotnet run --project Observables.Samples.Events -p:UseLocalObservables=true

See the samples repo build/README-LocalSourceGenerators.md.

Released under the MIT License.