multiple request getting fired cycle js
<p>I am trying to write an application in cycle js using the cycle js http driver. Here's the response subscriptions for the call which is getting fired 3 times. </p>

<p>One subscription i need in the login page and another in the main. It's like:</p>

<p>login:</p>

<pre><code>const response$ = http
    .filter(res =&gt; res.request.url.indexOf("test/v3/users/login")&gt;=0)
    .flatMap(x =&gt; x.catch(err =&gt; Observable.just({err})))
    .map(response =&gt; {
        if(isErr(response)){
            return extractError(response)
        }
        else{
            return extractResponse(response)
        }
    })

const x$ = response$.filter(x =&gt; x.status === "success").map(x =&gt; {return {key: "b", value: x.session.b_token}})
</code></pre>

<p>main function:</p>

<pre><code>const loginStorage$ = sources.http
    .filter(res =&gt; res.request.url.indexOf("test/v3/users/login")&gt;=0)
    .flatMap(x =&gt; x.catch(err =&gt; Observable.just({err})))
    .map(response =&gt; {
        if(isErr(response)){
            return extractError(response)
        }
        else{
            return extractResponse(response)
        }
    })
    .filter(x =&gt; x.status === 'success').map(x =&gt; {return {key: "a", value: x.session.id}})
</code></pre>

<p>Any help appreciated!!</p>