Skip to content

Instantly share code, notes, and snippets.

@jasdev
Last active April 11, 2020 03:51
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/b2fa2aebf373b7a93ca80890debe8ca8 to your computer and use it in GitHub Desktop.
Save jasdev/b2fa2aebf373b7a93ca80890debe8ca8 to your computer and use it in GitHub Desktop.
`Set.store(_:)` example.
import CombineExt
firstPublisher
.sink( /* … */ )
.store(in: &subscriptions)
secondPublisher
.sink( /* … */ )
.store(in: &subscriptions)
thirdPublisher
.sink( /* … */ )
.store(in: &subscriptions)
/// can be rewritten as,
subscriptions.store(
firstPublisher
.sink( /* … */ ),
secondPublisher
.sink( /* … */ ),
thirdPublisher
.sink( /* … */ )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment