method share
Documentation for method share
assembled from the following types:
class Supply
From Supply
(Supply) method share
method share(Supply: --> Supply)
Creates a live supply from an on-demand supply, thus making it possible to share the values of the on-demand supply on multiple taps, instead of each tap seeing its own copy of all values from the on-demand supply.
# this says in turn: "first 1" "first 2" "second 2" "first 3" "second 3"my = Supply.interval(1).share;.tap: ;sleep 1.1;.tap: ;sleep 2