fix(website): Fix infinite loop in scenegraph example #9248
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the scenegraph example makes infinite continuous requests for
all.json
locally for me. On the production website I'm not seeing anything because the OpenSky API returns 429s, but it might be that my IP address has just been rate limited.I think the current behavior leads to continuous requests, because
data
is assigned in the loop callback, butdata
is also a dependency of the effect so these changes trigger more requests. I've refactored a bit and this fixes the issue locally, but I'm still blocked by the OpenSky API and can't test with real data.Aside - Given that it only updates every 60s, maybe it'd be simpler (for purposes of showing a scenegraph example) to make a single request and skip the refresh cycle?