-
Notifications
You must be signed in to change notification settings - Fork 0
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
Read-only trackedParam #2
Comments
The reason trackedParam is a property decorator is that the property is the true owner of the state. Since that would not be true for this read-only one, I think it would be better if it was something like a resource. But also, I'm not convinced it's a good idea. The way I'm thinking about trackedParam, it doesn't change the data flow within the application. It works like normal If you want to share a tracked value across disparate parts of an application, you can use |
Shouldn't the URL be the true owner of the state and |
(I'm picking up some work on this addon after a long time working on other things.) To followup on this older discussion: the case where the URL is the true owner of the state is also a reasonable case, but it's a different case from what this addon is for. When the user is typing in a field and that field is being copied to a param in the URL, the URL really is not the authoritative source of state. The user's The other case, where the URL is the authoritative source, is already how normal route params are handled. In: this.route('somewhere', { path: '/somewhere/:id' }); The I think we should make it possible to do: this.route('somewhere', { path: '/somewhere?q=:id' }) for the case where the URL should own a param, but the param is optional and appears in a |
A read-only version of
trackedParam
decorator would be great. I understand that having more than one active component (or controller, route, service, ...) managing the same query parameter could be a footgun. Preventing it by API design is a good decision in my opinion. But more than one component (or controller, route, service, ...) should be able to read the current value to prevent property drilling or services only needed to passthrough query parameter read access.The text was updated successfully, but these errors were encountered: