2.0.0 • Published 7 years ago

jquery.promise v2.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

jquery.promise

Lighweight promise implementation using jQuery (1.26 KB, 456 B gzipped).

Installation

Using a script tag:

<script src="https://unpkg.com/jquery@3.2.1/dist/jquery.js"></script>
<script src="https://unpkg.com/jquery.promise@2.0.0/dist/jquery.promise.js"></script>

Using NPM:

$ npm install jquery.promise -S

This package doesn't work in node due to jQuery not being able to run without a browser. You can still use webpack to compile your assets.

Usage

Using a script tag:

<script>
  const promise = new $.Promise((resolve, reject) => {
    setTimeout(resolve, 1000);
  });
</script>

Using webpack:

import Promise from 'jquery.promise';

const promise = new Promise((resolve, reject) => {
  setTimeout(resolve, 1000);
});

promise.then(() => console.log('resolved'));

// Static methods
Promise.resolve();
Promise.reject();
Promise.all([ /* ...promises */ ]);
2.0.0

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago