Functions with dependencies are not updated
See original GitHub issueDescribe the bug
When rendering content (ie text) my expectation was that i could put the expression into a function on the context object and have the content updated whenever the depencency (ie count
) is changed.
To Reproduce Intuitively I would expect both buttons to show the same text:
<div l-use="{ count: 0, text() { return this.count + ' hi'; } }">
<button l-text="text()" l-on:click="++count">0</button>
<button l-text="count + ' hi'" l-on:click="++count">0</button>
</div>
If this is not intended or should be done any other way, it’s probably because the documentation is a bit scarce…
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Dependencies in React useEffect cleanup function are not ...
I am facing a strange issue when trying to call a cleanup function on component unmount with useEffect. In my useEffect return I...
Read more >How to Ensure That Your Dependencies Are Up to Date
Dependency management is a common challenge when scaling apps. Here are some easy ways to keep your dependencies up to date.
Read more >Dependencies Slow to Update + Way to force dependencies ...
I have a relatively simple plan ~ 50 tasks, and total of about 100 sub tasks. I've only just added the dependencies for...
Read more >Updating the Dependencies
Updating dependencies should be a regular part of your job. Use our DX Scanner practice called DependeciesVersion to find out if the libraries...
Read more >Update of local dependencies does not work #7426 - GitHub
I have some local dependencies on sub-modules in the same git repo ... If npm install does not update dependencies with local paths...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good point, the documentation doesn’t reflect the intended use. I will update that. @phoet feel free to open a PR to update it yourself too.
@phoet I don’t believe it is actually possible with our current structure to update the dependencies of functions. Use pure functions like this. If you feel that we should allow updating dependencies of functions feel free to open a feature request.