You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
Is it a normal behaviour for an observer set on routeData to fire after navigating away from an element?
I use the stock PSK, with iron-pages. I have created two pages: A, B - each having app-location and an observer set for routeData so when this changes, data gets fetched from the server.
The issue is, page A starts making requests when I navigate to page B.
Should I somehow unregister the observers manually?
Expected outcome
Observer set in page A on routeData should be removed once the user navigates to page B.
Yes, once you load a view it stays loaded so if you've set an observer it will keep updating. I tried to explain what's going on and give some options to make the non-active views inert in this blog post. There are a few different approaches you can use.
You can also use dom-if and visible (iron-pages) to activate or deactivate the app-route. In this way the app-route of the children pages will not do anything if they are not being visible.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
Is it a normal behaviour for an observer set on
routeData
to fire after navigating away from an element?I use the stock PSK, with
iron-pages
. I have created two pages: A, B - each havingapp-location
and an observer set forrouteData
so when this changes, data gets fetched from the server.The issue is, page A starts making requests when I navigate to page B.
Should I somehow unregister the observers manually?
Expected outcome
Observer set in page A on
routeData
should be removed once the user navigates to page B.page A:
page B:
The text was updated successfully, but these errors were encountered: