Skip to content

Conversation

@drummer1992
Copy link
Contributor

Changes:

  • Add abortSignal property to Request class (initialized as null)
  • Implement setAbortSignal(abortSignal) method for fluent API
  • Pass abort signal through the request pipeline to underlying HTTP clients
  • Update sendNodeAPIRequest to accept and apply abort signal to fetch options
  • Update sendXmlHttpRequest to accept and apply abort signal to XMLHttpRequest
  • Add test coverage for abort signal functionality

Usage:

const abortController = new AbortController();

Request.get('https://api.example.com/data')
  .setAbortSignal(abortController.signal)
  .then(result => console.log(result));

// Cancel the request
abortController.abort();

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.

1 participant