c# - How to 'delay' observable sequence by one value? -
in reactive extensions, how can 'delay' observable sequence 1 value? example:
original: 2 3 5 7 9 delayed: 2 3 5 7
to clear, want delay sequence 1 step. isn't same delaying constant time.
try this:
var delayedbyone = source.zip(source.skip(1), (x, _) => x);
but may need avoid running 2 concurrent sources if have cold observable source:
var delayedbyone = source.publish(s => s.zip(s.skip(1), (x, _) => x));
Comments
Post a Comment