ember-contextual-services
ember-contextual-services copied to clipboard
Fix route lifecycle issues
Please read commit descriptions to understand those changes. This gives complex examples but at least it's correct from a promise flow POV.
To avoid this vivious cycle we must initialize contextual services after the transition is completed.
do we want to do that? it means we can't access query params until the transition is done.
If we instead cache based on URL / transition.intent? maybe that would be better?
To avoid this vivious cycle we must initialize contextual services after the transition is completed.
do we want to do that? it means we can't access query params until the transition is done.
initialized
may not be the right term.
We must resolve personService
dependency injection when the transition is complete.
If we instead cache based on URL / transition.intent? maybe that would be better?
The issue is mainly here: https://github.com/NullVoxPopuli/ember-contextual-services/blob/master/addon/utils.ts#L24 We cannot be based on:
- URL as dynamic segment will not work.
-
transition.intent
as router service doesn't have access to the current transition.
Sorry it's been so long
URL as dynamic segment will not work.
Kinda depends on how we want them to work, we can make them work with a different cache key format.
transition.intent as router service doesn't have access to the current transition.
the current transition is just transition
though, why would we need to access that same object from the intent?