Files
ShrinkEventBus/Integration/Runtime/ShrinkSharedMainThreadDispatcher.cs
T

21 lines
640 B
C#

#if SHRINK_EVENTBUS_HAS_SHARED_RUNTIME
using System;
using ShrinkSDK.Runtime;
namespace ShrinkEventBus.Integration
{
public sealed class ShrinkSharedMainThreadDispatcher : IShrinkEventBusMainThreadDispatcher
{
private readonly IShrinkMainThreadDispatcher _dispatcher;
public ShrinkSharedMainThreadDispatcher(IShrinkMainThreadDispatcher dispatcher)
{
_dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
}
public bool IsMainThread => _dispatcher.IsMainThread;
public bool TryPost(Action action) => _dispatcher.TryPost(action);
}
}
#endif