title: How to create a Flux from a function that converts a state into a value and a new state?
body: <p>I have a function that takes a <code>State</code> and produces a new <code>State</code> and a <code>Value</code>.</p>
  
  <p>How do I create a Flux from that?</p>
  
  <p>Or to speak code:</p>
  
  <pre><code>Function&lt;State, Pair&lt;State, Value&gt; f = ...;
  
  Flux&lt;Value&gt; values = xxx(f); 
  </code></pre>
  
  <p>What is <code>xxx</code>?</p>