Last active
November 7, 2017 21:43
-
-
Save RolandPheasant/588e2196d83c875fa8dcea9aebe4edd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ObservableEx | |
{ | |
public static IObservable<IChangeSet<T>> BufferInitial<T>(this IObservable<IChangeSet<T>> source, TimeSpan initalBuffer, IScheduler scheduler = null) | |
{ | |
return source.DeferUntilLoaded().Publish(shared => | |
{ | |
var initial = shared.Buffer(initalBuffer, scheduler ?? Scheduler.Default) | |
.FlattenBufferResult() | |
.Take(1); | |
return initial.Concat(shared); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment