forked from reactiveui/ReactiveUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObservable.cs
More file actions
30 lines (26 loc) · 1.09 KB
/
Observable.cs
File metadata and controls
30 lines (26 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2022 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
namespace System.Reactive.Linq;
/// <summary>
/// Provides commonly required, statically-allocated, pre-canned observables.
/// </summary>
/// <typeparam name="T">
/// The observable type.
/// </typeparam>
internal static class Observable<T>
{
/// <summary>
/// An empty observable of type <typeparamref name="T"/>.
/// </summary>
public static readonly IObservable<T> Empty = Observable.Empty<T>();
/// <summary>
/// An observable of type <typeparamref name="T"/> that never ticks a value.
/// </summary>
public static readonly IObservable<T> Never = Observable.Never<T>();
/// <summary>
/// An observable of type <typeparamref name="T"/> that ticks a single, default value.
/// </summary>
public static readonly IObservable<T> Default = Observable.Return(default(T)!);
}