Open Mika5652 opened 4 months ago
You could use the chain(_:_:)
free function for this, in fact see the first example on the documentation page where a preamble
of 3 elements is prepended to another async sequence.
@pyrtsa Seems like this chain(_:_:)
replaces the prepend
operator only partly, because prepend
in Combine can be used in any part of the chain.
For instance:
struct Foo {
let bar: String
}
let subject = PassthroughSubject<Foo, Never>()
subject
.prepend(Foo(bar: "bar"))
.map(\.bar)
.prepend("foo")
...
I don't know if this is possible with the chain, but I will try it and maybe it fits my needs.
Thanks for the fast response anyway!
Hi there, I was looking for some equivalent to Combine's prepend operator but I didn't find anything. Is there any plan to introduce this feature into the structured concurrency world? Thanks!