diff --git a/bower.json b/bower.json index 487b409..07fd4d6 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-fetch-client", - "version": "1.6.0", + "version": "1.7.0", "description": "A simple client based on the Fetch standard.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-fetch-client.js b/dist/amd/aurelia-fetch-client.js index a31ee39..7436396 100644 --- a/dist/amd/aurelia-fetch-client.js +++ b/dist/amd/aurelia-fetch-client.js @@ -369,6 +369,12 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) { function trackRequestStart() { this.isRequesting = !!++this.activeRequestCount; + if (this.isRequesting) { + var evt = _aureliaPal.DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true }); + setTimeout(function () { + return _aureliaPal.DOM.dispatchEvent(evt); + }, 1); + } } function trackRequestEnd() { diff --git a/dist/aurelia-fetch-client.js b/dist/aurelia-fetch-client.js index 50cfe49..cdb8720 100644 --- a/dist/aurelia-fetch-client.js +++ b/dist/aurelia-fetch-client.js @@ -592,6 +592,10 @@ const absoluteUrlRegexp = /^([a-z][a-z0-9+\-.]*:)?\/\//i; function trackRequestStart() { this.isRequesting = !!(++this.activeRequestCount); + if (this.isRequesting) { + let evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true }); + setTimeout(() => DOM.dispatchEvent(evt), 1); + } } function trackRequestEnd() { diff --git a/dist/commonjs/aurelia-fetch-client.js b/dist/commonjs/aurelia-fetch-client.js index e3064bb..6e2b9be 100644 --- a/dist/commonjs/aurelia-fetch-client.js +++ b/dist/commonjs/aurelia-fetch-client.js @@ -367,6 +367,12 @@ var absoluteUrlRegexp = /^([a-z][a-z0-9+\-.]*:)?\/\//i; function trackRequestStart() { this.isRequesting = !!++this.activeRequestCount; + if (this.isRequesting) { + var evt = _aureliaPal.DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true }); + setTimeout(function () { + return _aureliaPal.DOM.dispatchEvent(evt); + }, 1); + } } function trackRequestEnd() { diff --git a/dist/es2015/aurelia-fetch-client.js b/dist/es2015/aurelia-fetch-client.js index c682698..95082e2 100644 --- a/dist/es2015/aurelia-fetch-client.js +++ b/dist/es2015/aurelia-fetch-client.js @@ -290,6 +290,10 @@ const absoluteUrlRegexp = /^([a-z][a-z0-9+\-.]*:)?\/\//i; function trackRequestStart() { this.isRequesting = !!++this.activeRequestCount; + if (this.isRequesting) { + let evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true }); + setTimeout(() => DOM.dispatchEvent(evt), 1); + } } function trackRequestEnd() { diff --git a/dist/native-modules/aurelia-fetch-client.js b/dist/native-modules/aurelia-fetch-client.js index e903cf6..b1ccf6b 100644 --- a/dist/native-modules/aurelia-fetch-client.js +++ b/dist/native-modules/aurelia-fetch-client.js @@ -358,6 +358,12 @@ var absoluteUrlRegexp = /^([a-z][a-z0-9+\-.]*:)?\/\//i; function trackRequestStart() { this.isRequesting = !!++this.activeRequestCount; + if (this.isRequesting) { + var evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true }); + setTimeout(function () { + return DOM.dispatchEvent(evt); + }, 1); + } } function trackRequestEnd() { diff --git a/dist/system/aurelia-fetch-client.js b/dist/system/aurelia-fetch-client.js index 188f71b..556ae64 100644 --- a/dist/system/aurelia-fetch-client.js +++ b/dist/system/aurelia-fetch-client.js @@ -49,6 +49,12 @@ System.register(['aurelia-pal'], function (_export, _context) { function trackRequestStart() { this.isRequesting = !!++this.activeRequestCount; + if (this.isRequesting) { + var evt = DOM.createCustomEvent('aurelia-fetch-client-request-started', { bubbles: true, cancelable: true }); + setTimeout(function () { + return DOM.dispatchEvent(evt); + }, 1); + } } function trackRequestEnd() { diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 37db7df..03fa695 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,10 @@ + +# [1.7.0](https://github.com/aurelia/fetch-client/compare/1.6.0...1.7.0) (2018-12-01) + +### Features + +* added 'aurelia-fetch-client-request-started' event + # [1.6.0](https://github.com/aurelia/fetch-client/compare/1.5.0...1.6.0) (2018-09-25) diff --git a/package.json b/package.json index f645c42..2dbdf4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-fetch-client", - "version": "1.6.0", + "version": "1.7.0", "description": "A simple client based on the Fetch standard.", "keywords": [ "aurelia",