Skip to content

Instantly share code, notes, and snippets.

@Arrlindii
Last active June 25, 2019 16:12
Show Gist options
  • Select an option

  • Save Arrlindii/03043c45d9649615071f9f7331f86692 to your computer and use it in GitHub Desktop.

Select an option

Save Arrlindii/03043c45d9649615071f9f7331f86692 to your computer and use it in GitHub Desktop.
let testData = (1...1000000).map { _ in randomString(length: 8) }
func testCombineSwift() {
_ = Publishers.Sequence(sequence: testData)
.flatMap { Publishers.Just($0) }
.map {$0.lowercased()}
.removeDuplicates()
.filter({$0.contains("a")})
.dropFirst(2)
.sink(receiveValue: { value in
print(value)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment