public static IDisposable Bind <T>( this IObservable <T> source, IReactiveCommand <T> target, int frameThrottle = 1) { return(source. BatchPlayerTiming(frameThrottle, PlayerLoopTiming.LastPostLateUpdate). Where(x => target.CanExecute.Value). Subscribe(x => target.Execute(x))); }
public static IDisposable Bind <T>( this IObservable <T> source, Action <T> target, int frameThrottle = 1) { if (source == null) { GameLog.LogWarning($"BindingExtension: NULL IObservable<T> detected with type {typeof(T).Name}"); return(Disposable.Empty); } return(source. BatchPlayerTiming(frameThrottle, PlayerLoopTiming.LastPostLateUpdate). Subscribe(target)); }