Skip to content

Instantly share code, notes, and snippets.

@ramunasjurgilas
Created February 27, 2020 12:08
Show Gist options
  • Save ramunasjurgilas/cc77ee90cc8d37e8b027eb1c3a4fc681 to your computer and use it in GitHub Desktop.
Save ramunasjurgilas/cc77ee90cc8d37e8b027eb1c3a4fc681 to your computer and use it in GitHub Desktop.
Combining operator: append(_:)
let integers = (10...12).publisher // A
let moreIntegers = (20...22).publisher // F
integers
.append(1, 2) // B
.append(99...101) // C
.append([-100, -200]) // D
.append(moreIntegers) // E
.sink { print($0) }
// Output:
// 10 // From A
// 11 // From A
// 12 // From A
// 1 // From B
// 2 // From B
// 99 // From C
// 100 // From C
// 101 // From C
// -100 // From D
// -200 // From D
// 20 // From E
// 21 // From E
// 22 // From E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment