Skip to content

EvandroLG/P

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

P

It's an agnostic, cross-browser and very lightweight library to help you to work with Promise in JavaScript.

Browser Compatibility

P is compatible with the following browsers/versions:

  • Google Chrome
  • Firefox
  • Safari
  • IOS Safari
  • Opera
  • IE 7+

Methods

  • P.init().resolve(params)
  • P.init().reject(params)
  • P.init().then(callback)

Example

var context = {name: 'Evandro', year: 27};
var p = P.init(context);

window.load = function(delay) {
  setTimeout(function(){
    p.resolve();
  }, delay);

  return p;
};

window.load(200).then(function() {
  console.log('name = ', this.name);
  console.log('year = ', this.year);
});

About

It's a cross-browser, agnostic and very lightweight library to help you to work with Promise in JavaScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published