public static UniTask RaiseIfNotNull <T>(this AsyncEventRaiser <T>?raiser, T arg, CancellationToken cancellationToken = default) { if (raiser is not null) { return(raiser.Raise(arg, cancellationToken)); } else { if (cancellationToken.IsCancellationRequested) { return(UniTask.FromCanceled(cancellationToken)); } else { return(UniTask.CompletedTask); } } }
internal AsyncEventUnsubscriber(AsyncEventRaiser <T>?raiser, Func <T, CancellationToken, UniTask>?func) { _raiser = raiser; _func = func; }