How to properly use an observable with Redux store and routing
<p>Using the <a href="https://github.com/reactjs/redux/tree/master/examples/real-world" rel="nofollow">real-world example from Redux</a>, where would one best define an observable and then listeners on the <em>Redux</em> store?  For example from <a href="https://github.com/reactjs/redux/issues/227#issuecomment-119237073" rel="nofollow">this Redux discussion thread</a>, when utilizing <em>redux-rx</em> where should the following code be placed in the <em>real-world</em> example?</p>

<pre><code>const state$ = observableFromStore(store);

const didLogin$ = state$
    .distinctUntilChanged(state =&gt; !state.loggedIn &amp;&amp; state.router.path === '/login')
    .filter(state =&gt; state.loggedIn &amp;&amp; state.router.path === '/login');

didLogin$.subscribe({
    router.transitionTo('/success');
});
</code></pre>

<p>I was initially thinking that I would define this within containers/App.js but at that level the redux store is not available like it is in index.js and containers/Root.dev.js.  Perhaps utilizing React <em>context</em> somehow?  I am using a <em>reselect</em> selector for my <code>connect()</code> calls if that makes any difference.</p>