Stubs.cs 1002 B

123456789101112131415161718192021222324252627282930
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Reactive
  5. {
  6. internal static class Stubs<T>
  7. {
  8. public static readonly Action<T> Ignore = static _ => { };
  9. public static readonly Func<T, T> I = static _ => _;
  10. }
  11. internal static class Stubs
  12. {
  13. public static readonly Action Nop = static () => { };
  14. public static readonly Action<Exception> Throw = static ex => { ex.Throw(); };
  15. }
  16. #if !NO_THREAD
  17. internal static class TimerStubs
  18. {
  19. #if NETSTANDARD1_3
  20. public static readonly System.Threading.Timer Never = new System.Threading.Timer(static _ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
  21. #else
  22. public static readonly System.Threading.Timer Never = new System.Threading.Timer(static _ => { });
  23. #endif
  24. }
  25. #endif
  26. }