Skip to content

Instantly share code, notes, and snippets.

@therohansanap
Created April 5, 2020 10:31
Show Gist options
  • Select an option

  • Save therohansanap/b1c286a20c7fd990d7fc09a7207f39eb to your computer and use it in GitHub Desktop.

Select an option

Save therohansanap/b1c286a20c7fd990d7fc09a7207f39eb to your computer and use it in GitHub Desktop.
let safeSequence = xs
.observeOn(MainScheduler.instance) // observe events on main scheduler
.catchErrorJustReturn(onErrorJustReturn) // can't error out
.share(replay: 1, scope: .whileConnected) // side effects sharing
return Driver(raw: safeSequence) // wrap it up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment