Stubs.cs 970 B

1234567891011121314151617181920212223242526272829
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the Apache 2.0 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 = _ => { };
  9. public static readonly Func<T, T> I = _ => _;
  10. }
  11. internal static class Stubs
  12. {
  13. public static readonly Action Nop = () => { };
  14. public static readonly Action<Exception> Throw = 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(_ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
  21. #else
  22. public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { });
  23. #endif
  24. }
  25. #endif
  26. }