cyclejs-community / cyclic-router

Router Driver built for Cycle.js
MIT License
109 stars 24 forks source link

After a while the router becomes too slow - rxjs #188

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi folks! I'm using cyclic-router on a cycle/rxjs app. The router is working, but, after some clicks (navigation) this becomes too slow, I mean, im not doing anything else but clicking the a tags i've added.

I created this sample repo to repro the issue: clone, npm install -> npm start -> navigate between the two pages -> checkout how this become "slow"

am i missing something?

TylorS commented 7 years ago

I haven't tested in myself, but I'd try using switchMap instead of flatMap as a preliminary attempt. flatMap will keep subscriptions forever, whereas switchMap will only keep the most recent, which in the case of routing is generally what you want.