Let's say I have two signals
textField1Signal
|> map { value in
return value.lowercaseString
}
|> on (
next: { value in
println("textField1 changed to \(value)");
}
)
textField2Signal
|> map { value in
return value.lowercaseString
}
|> on (
next: { value in
println("textField2 changed to \(value)");
}
)
What I would like to achieve is something like this:
(textField1Signal & textField2Signal)
|> map { value in
return value.lowercaseString
}
|> on (
next: { value in
println("one of the textFields changed to \(value)");
}
)
The point is I have several Signals and I want to handle all of them the same way. combineLatest:
does not work in this case because first of all it is not fired when only one of the signals fires and second of all I would get the values from both textfields and wouldn't know which one actually caused the invocation.
With Jakub Vanos help I was able to find the following solution