Skip to content

jordrake/pron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pron v0.1.0

Convert jQuery events to jQuery Deferreds

Installation

Pron supports installation via npm:

npm install pron

or bower (source and distribution files only, no tests or build tasks):

bower install pron

Works with RequireJS, CommonJS implementations. To use in standard jQuery in the browser just load the pron.js in either the dist (minified) or src folder.

Usage

Pron has been developed to support jQuery event syntax as much as possible with additional functionality for multiple required events.

Single event:

$('body').pron('event1').then(function(){ ... });

The promise would resolve when event1 is triggered.

Multiple optional events:

Much like jQuery event syntax, this uses a single string with space seperated events.

$('body').pron('event1 event2').then(function(){ ... });

The promise would resolve when either event1 or event2 is triggered.

Multiple required events:

This takes comma seperate event strings (you can even use multiple optional events within these).

$('body').pron('event1','event2').then(function(){ ... });

The promise would resolve when both event1 and event2 have been triggered.

About

Convert jQuery events to a jQuery Deferred

Resources

License

Stars

Watchers

Forks

Packages

No packages published