ass="summary source-code" id="source">
      <h2><span>Implementation</span></h2>
      <pre class="language-dart"><code class="language-dart">Future&lt;S&gt; fold&lt;S&gt;(S initialValue, S combine(S previous, T element)) {
  _Future&lt;S&gt; result = new _Future&lt;S&gt;();
  S value = initialValue;
  StreamSubscription subscription;
  subscription = this.listen(
      (T element) {
        _runUserCode(() =&gt; combine(value, element), (S newValue) {
          value = newValue;
        }, _cancelAndError