Hey guys! Could you think of a better solution for...
# rx
y
Hey guys! Could you think of a better solution for emitting an event with a delay after the first emission from
Observable
?
Copy code
just(1)
    .flatMap { just(2).delay(1, SECONDS).startWith(it) }
    .subscribe { println(it) }
Just curious if I’m missing on some operator which does the thing.
z
I think you could use
andThen
concat
to keep the ordering a little more natural.
y
isn’t
andThen
for
Completable
only?
z
sorry,
concat
y
that’s a good point, thank you
u
maybe this? `
Copy code
Observable.merge(
   source.take(1), 
   source.skip(1).delay(..)
)
just make sure to refcount the source if its cold
y
thanks, Vlastimil, it looks like an option too.