def create(): def mapper(_xs): return _xs.pipe( ops.zip(_xs.pipe(ops.skip(1))), ops.map(sum), ) return xs.pipe(ops.publish_value(1979, mapper))
def test_publish_with_initial_value_multiple_connections(self): xs = rx.never() ys = xs.pipe(ops.publish_value(1979)) connection1 = ys.connect() connection2 = ys.connect() assert (connection1 == connection2) connection1.dispose() connection2.dispose() connection3 = ys.connect() assert (connection1 != connection3)
def action0(scheduler, state): ys[0] = xs.pipe(ops.publish_value(1979))