2.0.2 • Published 4 years ago

ajax-notify v2.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

Ajax-Notify

This package adds event listeners to XMLHttpRequest and fetch calls. Whenever ajax is called using this two functions, provided callback function will be called.

Api

This package exposes only one function as default.

const { ajaxNotify } = require('ajax-notify');
ajaxNotify(sutStringOrRegExp, (xhr, responseUrl) => {
    // xhr is undefined in case of fetch request
    console.log('request done', xhr, responseUrl);
} )

Here ajaxNotify variable is a function. It has two arguments.

  • urlSubString: string or regular expression which will be included or tested in request url
  • callback: a function which will be executed when request url includes urlSubString.

NOTE:

  • I haven't considered microsoft's ActiveX objects support because, negligible number browsers use it.
2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago