Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jasdev
Last active April 5, 2020 01:43
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 jasdev/34948b0a2a1ede6356e3e96c9ff59a86 to your computer and use it in GitHub Desktop.
Save jasdev/34948b0a2a1ede6356e3e96c9ff59a86 to your computer and use it in GitHub Desktop.
`Just`’s `ignoreOutPut` overload.
Just("someString")
.ignoreOutput() /// (1) Combine specializes
/// [`Just`’s overload of `ignoreOutput`](https://developer.apple.com/documentation/combine/just/3343929-ignoreoutput)
/// to return an `Empty<String, Never>` (note, the output type didn’t get `Never`’d out) instead of wrapping
/// it a [`Publishers.IgnoreOutput`](https://developer.apple.com/documentation/combine/publishers/ignoreoutput) level.
.append("anotherStringPostFinished") /// (2) Since upstream is an `Empty<String, Never>` and the
/// `Output` generic _didn’t_ get `Never`’d out, the `append` here can carry on accepting `String`s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment