How to tie emitted events events into redux-saga? : <p>I'm trying to use <a href="https://github.com/yelouafi/redux-saga">redux-saga</a> to connect events from <a href="http://pouchdb.com/api.html#replication">PouchDB</a> to my <a href="http://reactjs.com/">React.js</a> application, but I'm struggling to figure out how to connect events emitted from PouchDB to my Saga. Since the event uses a callback function (and I can't pass it a generator), I can't use <code>yield put()</code> inside the callback, it gives weird errors after ES2015 compilation (using Webpack).</p>

<p>So here's what I'm trying to accomplish, the part that doesn't work is inside <code>replication.on('change' (info) =&gt; {})</code>.</p>

<pre><code>function * startReplication (wrapper) {
  while (yield take(DATABASE_SET_CONFIGURATION)) {
    yield call(wrapper.connect.bind(wrapper))

    // Returns a promise, or false.
    let replication = wrapper.replicate()

    if (replication) {
      replication.on('change', (info) =&gt; {
        yield put(replicationChange(info))
      })
    }
  }
}

export default [ startReplication ]
</code></pre>
