title: How to write auto-toggle Publisher operator?
body: <p>because of a requirement to auto remove <code>Text</code> after its appearance in 2 seconds, I want to write this operator but still cannot figure out the best way to implement.</p>
  <p><a href="https://i.stack.imgur.com/TsLL1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TsLL1.jpg" alt="enter image description here" /></a></p>
  <p>We can put a timespan parameter and get a new stream, here are two interfaces need to implement</p>
  <pre><code>extension Publisher {
      func reset&lt;T, S: Scheduler&gt;(
          after: S.SchedulerTimeType.Stride,
          on scheduler: S
      ) -&gt; AnyPublisher&lt;T, Failure&gt; where Output == Optional&lt;T&gt; {
          // implementation
      }
      
      func autoToggle&lt;S: Scheduler&gt;(
          after: S.SchedulerTimeType.Stride,
          on scheduler: S
      ) -&gt; AnyPublisher&lt;Bool, Failure&gt; {
          // implementation
      }
  }
  </code></pre>
  <p>Really appreciate your help.</p>