Skip to content
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

Improve Widgets calculations sync with tiles #223

Merged

Conversation

Clebal
Copy link
Contributor

@Clebal Clebal commented Nov 5, 2021

Story details: https://app.shortcut.com/cartoteam/story/148156

Approach:

I store in a ref the timeoutId of the debounced function. Everytime that an update in tiles or viewport can happens, the debounce is cleared.
Using fetch, we know that a tile is being fetched. Knowing that, we can stop the debounce because we know in advance that in a few seconds a tile will be loaded, avoiding unnecessary calculations.

@Clebal Clebal requested a review from VictorVelarde November 5, 2021 09:33
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #148156: Widgets calculations not synced with tiles.

@coveralls
Copy link
Collaborator

coveralls commented Nov 5, 2021

Pull Request Test Coverage Report for Build 1468274395

  • 6 of 15 (40.0%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 69.235%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/react-api/src/hooks/useViewportFeatures.js 4 13 30.77%
Files with Coverage Reduction New Missed Lines %
packages/react-api/src/hooks/useViewportFeatures.js 1 36.56%
Totals Coverage Status
Change from base Build 1398218595: -0.3%
Covered Lines: 895
Relevant Lines: 1209

💛 - Coveralls

@VictorVelarde
Copy link
Contributor

@Clebal CR looks fine to me. I would like to test it locally, and then see if we can prepare a patch.
We would need also a little PR for updating documentation, adding info about this new parameter. Would you please create that in documentation repo?

@Clebal
Copy link
Contributor Author

Clebal commented Nov 10, 2021

@VictorVelarde sure. I'll do it ASAP.

Copy link
Contributor

@padawannn padawannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks well. I like the approach

@VictorVelarde VictorVelarde changed the title Widgets calculations not synced with tiles Improve Widgets calculations sync with tiles Nov 16, 2021
@VictorVelarde VictorVelarde merged commit 12af8fb into master Nov 17, 2021
@VictorVelarde VictorVelarde deleted the bug/sc-148156/widgets-calculations-not-synced-with-tiles branch November 17, 2021 17:39
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.

4 participants