Skip to content

Instantly share code, notes, and snippets.

@chriswill0w
Created November 1, 2017 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriswill0w/00b490a62892b525589e880a2ae5f452 to your computer and use it in GitHub Desktop.
Save chriswill0w/00b490a62892b525589e880a2ae5f452 to your computer and use it in GitHub Desktop.
private extension ObservableType {
func withPrevious(startWith first: E) -> Observable<(E, E)> {
return scan((first, first)) { ($0.1, $1) }.skip(1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment