Skip to content

An interceptor for Polymer's iron-request element that generates events on document object.

Notifications You must be signed in to change notification settings

gazal-k/xhr-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xhr-events Build Status

An interceptor for Polymer's iron-request element that generates events on document object.

Usage

Include in your polymer application.

<script src="../../bower_components/xhr-events/xhr-events.js"></script>

Add event listeners for xhr.

document.addEventListener('xhr-request', function(event) {
  console.log('xhr-request', event.detail);
});
document.addEventListener('xhr-response', function(event) {
  console.log('xhr-response', event.detail);
});
document.addEventListener('xhr-error', function(event) {
  console.log('xhr-error', event.detail);
});

Polyfill

For IE, use this polyfill

https://github.com/krambuhl/custom-event-polyfill

About

An interceptor for Polymer's iron-request element that generates events on document object.

Resources

Stars

Watchers

Forks

Packages

No packages published