-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature query: stateful routes (module + viewport) #534
Comments
Is this something you want in? @EisenbergEffect @bryanrsmith |
I like it! |
Adds stateful routes so that route configurations can specify a module or a module in a viewport as `stateful: true`. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Depending on aurelia/templating-router#64 and aurelia#536. Closes aurelia#534.
Adds stateful routes so that route configurations can specify a module or a module in a viewport as `stateful: true`. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Depending on aurelia/templating-router#64 and aurelia#536. Closes aurelia#534.
Adds stateful routes so that route configurations can specify a module or a module in a viewport as stateful: true. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Required by aurelia/router/stateful-viewports. Closes aurelia/router#534.
Adds stateful routes so that route configurations can specify a module or a module in a viewport as `stateful: true`. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Required by aurelia/router#538. Closes aurelia/router#534.
@jwx Isn't this solved by making your view model a app singleton? |
@EisenbergEffect see here |
@davismj @EisenbergEffect Making the view model a singleton only preserves the view model state. State details not bound to the view model is lost, for example an unbound scroll position in a list or unbound position and zooming in a google map. Basically, this is completely cached views through show and hide. |
Good info. I'll review again. I'd like to pull this in out of the context of the optional and default view ports. This seems like a totally separate item. |
I'd like to add in that making something |
Don't like the seeming hackiness of it. Kinda shoehorning. |
@Alexander-Taran See #538. |
Adds stateful routes so that route configurations can specify a module or a module in a viewport as `stateful: true`. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Depending on aurelia/templating-router#64 and aurelia#536. Closes aurelia#534.
Adds stateful routes so that route configurations can specify a module or a module in a viewport as stateful: true. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Required by aurelia/router/stateful-viewports. Closes aurelia/router#534.
Adds stateful routes so that route configurations can specify a module or a module in a viewport as `stateful: true`. A stateful module that's loaded in a viewport is never unloaded when navigating away, it's just not shown, and is displayed with the same state whenever a route places it in the same viewport again. Required by aurelia/router#538. Closes aurelia/router#534.
I've got code for stateful routes, meaning that if you do this
the same instance of the dashboard module will be presented in the default viewport everytime a stateful route specifies it after the initial time. The view/viewmodel will remain loaded even when navigating away to another route, meaning that state such as list sorting, entered values, positions on google maps etc will be the same when coming back to it. It also means that the viewmodel will be able to listen to and act upon events from the event manager, signals and so on.
So to clarify, this is not caching for views/viewmodels, it's stateful views/viewmodels that are never unloaded.
If this is of interest to anyone else and has any chance of being accepted into the router I could put together a PR.
The text was updated successfully, but these errors were encountered: