title: How can I reset accumulator of scan on ReplaySubject?
body: <p>I have a <code>ReplaySubject</code> that accumulate data with <code>scan</code> operator and every 10000 ms should be reset. Is there any another way to do it?</p>
  
  <p>Now:</p>
  
  <pre><code>let subject = new ReplaySubject();
  
  subject.scan((acc, cur) =&gt; {
              acc.push(cur);
              return acc;
          }, [])
          .subscribe(events =&gt; {
              localStorage.setItem('data', JSON.stringify(events))
          });
  
  subject
      .bufferTime(10000)
      .map(() =&gt; {
          subject.observers[0]._seed = [];
      })
      .subscribe(() =&gt; localStorage.removeItem('data'));
  </code></pre>