ended).</p>
<pre><code class="lang-javascript">var stream1 = stream(&quot;hello&quot;) // stream1 is active

var stream2 = stream() // stream2 starts off pending
stream2(&quot;world&quot;) // then becomes active
</code></pre>
<p>A dependent stream with multiple parents becomes active if all of its parents are active.</p>
<pre><code class="lang-javascript">var a = stream(&quot;hello&quot;)
var b = stream()

var greeting = stream.merge([a, b]).map(function(values) {
    return values.join(&quot; &quot;)
})
</