Skip to content

Commit

Permalink
Merge pull request #1767 from PathogenDavid/issue-1628
Browse files Browse the repository at this point in the history
Fix GateInterval not working after the first tick
  • Loading branch information
glopesdev authored Apr 30, 2024
2 parents d3317bb + 54b958a commit eb3ef6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Bonsai.Core/ObservableCombinators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static IObservable<TSource> Gate<TSource>(this IObservable<TSource> sourc
/// </returns>
public static IObservable<TSource> Gate<TSource>(this IObservable<TSource> source, TimeSpan interval, IScheduler scheduler)
{
return Gate(source, Observable.Timer(interval, scheduler));
return Gate(source, Observable.Interval(interval, scheduler));
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Bonsai.Core/Reactive/GateInterval.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public override IObservable<TSource> Process<TSource>(IObservable<TSource> sourc
{
var dueTime = DueTime;
var scheduler = HighResolutionScheduler.Default;
var interval = Observable.Timer(Interval, scheduler);
var interval = Observable.Interval(Interval, scheduler);
return dueTime.HasValue
? source.Gate(interval, dueTime.Value, scheduler)
: source.Gate(interval);
Expand Down

0 comments on commit eb3ef6f

Please sign in to comment.