VDT.Core.Operators
4.0.0
dotnet add package VDT.Core.Operators --version 4.0.0
NuGet\Install-Package VDT.Core.Operators -Version 4.0.0
<PackageReference Include="VDT.Core.Operators" Version="4.0.0" />
<PackageVersion Include="VDT.Core.Operators" Version="4.0.0" />
<PackageReference Include="VDT.Core.Operators" />
paket add VDT.Core.Operators --version 4.0.0
#r "nuget: VDT.Core.Operators, 4.0.0"
#:package VDT.Core.Operators@4.0.0
#addin nuget:?package=VDT.Core.Operators&version=4.0.0
#tool nuget:?package=VDT.Core.Operators&version=4.0.0
VDT.Core.Operators
Operators that process streams of published values from operand streams, allowing you to subscribe to the output stream for handling any sorts of events in a streamlined way. Create operand streams of the types you want to process, apply the required operators to those streams and subscribe to the results. Conceptually this is similar to piping observables, except an operand stream doesn't own the data it publishes - it's merely a conduit that's used for publishing, piping and subscribing. Below example uses a series of operators to ensure string values don't get published more than once every half a second and can be parsed as integers before subscribing to the resulting integer stream.
Features
- Asynchronous subscription to streams of values
- Asynchronous piping of values through a variety of operators to transform them
- Easily extensible with your own operators
Options
Each operand stream can be provided with an OperandStreamOptions object to specify how subscribers are interacted with.
ReplayWhenSubscribingtoggles the setting to publish all previously published values to a new subscriber when it is addedValueGeneratorsets a method that will be executed when an operand stream is subscribed to, providing initial valuesReplayValueGeneratorWhenSubscribingtoggles the setting to determine when to execute theValueGeneratorfalseto executeValueGeneratoronly for the first subscribertrueto executeValueGeneratorfor every subscriber
Please note that if ReplayWhenSubscribing and ReplayValueGeneratorWhenSubscribing are both false, any subscribers after the first will only receive
values from ValueGenerator generated after they are subscribed.
Operators
Debouncedelays and throttles output valuesFilterdiscards output values based on a predicateFlattensubscribes to a stream of streams and outputs values published by the child streamsGroupBygroups published values by using a key selectorIterateloops over received values ofIEnumerable<T>Maptransforms valuesMergemerges two or more streamsQueueThrottlethrottles output, queueing received valuesQueueZipoutputs tuples of values published by two streams, queueing received valuesThrottlethrottles output, discarding old received valuesZipoutputs tuples of values published by two streams, discarding old received values
Example
Below example uses a series of operators to ensure string values don't get published more than once every half a second and can be parsed as integers before subscribing to the resulting integer stream.
<input type="text" @oninput="async args => await valueStream.Publish(args.Value!.ToString()!)" />
@code {
private readonly IOperandStream<string> valueStream = new OperandStream<string>();
protected override void OnAfterRender(bool firstRender) {
if (firstRender) {
valueStream
.Debounce(500)
.Map(value => new { IsValid = int.TryParse(value, out var result), Result = result })
.Filter(value => value.IsValid)
.Map(value => value.Result)
.Subscribe(value => {
// Handle received integer values
});
}
}
}
Custom operators
Although many common operators are available out of the box, it is simple to create your own by implementing either
IOperator<TValue, TTransformedValue> to transform values without any initialization, or
IOperator<TValue, TTransformedValue, TInitializationData> to add an initialization method with data to the operator. For ease of use, you can then also
create extension methods for IOperandStream<TValue< that pipes values through your operator to the target stream.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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 is compatible. 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on VDT.Core.Operators:
| Package | Downloads |
|---|---|
|
VDT.Core.Blazor.XYChart
Blazor component to create SVG charts with a category X-axis and a value Y-axis such as bar, line and area charts |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0 | 33 | 1/18/2026 |
| 3.0.0 | 217 | 1/31/2025 |
| 2.0.0 | 146 | 1/25/2025 |
| 1.2.0 | 181 | 6/9/2024 |
| 1.1.0 | 183 | 5/17/2024 |
| 1.0.0 | 424 | 3/12/2024 |
| 0.6.0 | 189 | 2/26/2024 |
| 0.5.1 | 175 | 2/25/2024 |
| 0.5.0 | 172 | 2/24/2024 |
| 0.4.0 | 187 | 2/21/2024 |
| 0.3.1 | 194 | 2/21/2024 |
| 0.3.0 | 186 | 2/17/2024 |
| 0.2.0 | 198 | 2/10/2024 |
| 0.1.1 | 208 | 2/7/2024 |
| 0.1.0 | 205 | 2/7/2024 |
- Added explicit .net 10.0 support