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

Add utility function for pattern that issues a single AJAX request at a time #19239

Merged
merged 2 commits into from May 19, 2022

Conversation

diosmosis
Copy link
Member

Description:

This PR adds a new method that issues an AJAX request after aborting the existing ongoing request if one exists. This is a pattern I've seen a lot, it seemed worth adding a utility function to core.

Usage:

defineComponent({
  methods: {
    performRequest: oneAtATime<ResponseType>('MyPlugin.myMethod'),
    doSomething() {
      this.performRequest({ idSite, period, ... }).then(() => {
        // ...
      });
    },
  },
});

Review

@diosmosis diosmosis added the Needs Review PRs that need a code review label May 18, 2022
@diosmosis diosmosis added this to the 4.11.0 milestone May 18, 2022
@peterhashair peterhashair merged commit 742071e into 4.x-dev May 19, 2022
@peterhashair peterhashair deleted the vue-one-at-a-time branch May 19, 2022 01:46
@justinvelluppillai justinvelluppillai changed the title [Vue] add utility function for pattern that issues a single AJAX request at a time Add utility function for pattern that issues a single AJAX request at a time Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants