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

perf(wfs): cancel outgoing wfs xhr on pan/zoom #1421

Merged
merged 3 commits into from
Sep 29, 2023
Merged

Conversation

pelord
Copy link
Member

@pelord pelord commented Sep 27, 2023

Please check if the PR fulfills these requirements

What is the current behavior? (You can also link to an open issue here)
Previous wfs call are not cancelled on pan/zoom, and still, they are not loaded into the source.

What is the new behavior?
cancel outgoing wfs xhr on pan/zoom

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications:

Other information:

Copy link
Collaborator

@alecarn alecarn left a comment

Choose a reason for hiding this comment

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

Little details only, but look good to me!

(this.previousOgcFilters && this.previousOgcFilters !== ogcFilters)
) {
vectorSource.removeLoadedExtent(this.previousLoadExtent);
this.xhrAccumulator.map((xhr) => xhr.abort());
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could use the forEach instead of the map, it's more efficient for a simple iteration and even better would be the "for of". I think it's important in the scenario that this could be a very in-demand method.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@alecarn alecarn merged commit b796cec into release/16.0.0 Sep 29, 2023
1 check passed
@alecarn alecarn deleted the perf-wfs branch September 29, 2023 18:38
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