Skip to content

[5.x] Improve recursive behavior when using route data in computed values #11855

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

Open
wants to merge 3 commits into
base: 5.x
Choose a base branch
from

Conversation

JohnathonKoster
Copy link
Contributor

This PR fixes the issue described in #11853. When a computed value triggers the routeData method and the collection has a structure, you can end up in an infinite loop when fetching the entry.

This PR wraps computed values in a Value object to defer their execution only when resolving routeData. This is accomplished with two new methods:

  • getComputedData
  • getValues

Both of these methods allow the caller to wrap computed callbacks in a Value object. These methods are now used in the existing computedData and values methods. This was done to keep the signatures of these methods the same.

It will still be possible to cause infinite loops, depending on what the user is doing. The changes in #11854 will help with those scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants