-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
26 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
compile: coffee -cw *.coffee | ||
compile: coffee -cw *.coffee | ||
test: ./node_modules/mocha/bin/mocha *.js -Gw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
#Simply Deferred | ||
###Simplified jQuery Deferred API for Node and the browser | ||
###jQuery-like Deferred API for Node and the browser | ||
|
||
##Installation | ||
npm install simply-deferred | ||
|
||
|
||
##Usage | ||
var Deferred = require('simply-deferred').Deferred; | ||
var Deferred = require('simply-deferred').Deferred; | ||
var rendering = new Deferred(); | ||
rendering.done(function(){ | ||
console.log('Finished rendering'); | ||
}); | ||
|
||
//... | ||
|
||
rendering.resolve(); | ||
|
||
##API | ||
Simply Deferred is partially compatible with jQuery's API, so the [docs and usage](http://api.jquery.com/category/deferred-object/) are the same, except that they're restricted to the following methods: | ||
Simply Deferred is fullly compatible with jQuery's API, so the [docs and usage](http://api.jquery.com/category/deferred-object/) are the same. Like the jQuery deferred API, it provides the following methods: | ||
|
||
* `Deferred()` | ||
* `deferred.state()` | ||
|
@@ -36,19 +36,24 @@ Simply Deferred is partially compatible with jQuery's API, so the [docs and usag | |
* `deferred.then()` | ||
* `when()` | ||
|
||
###Collaborating | ||
Please feel free to raise issues on [github.com/sudhirj/simply-deferred/issues](https://github.com/sudhirj/simply-deferred/issues) - both obvious bugs or incompatibilities with jQuery are welcome. | ||
|
||
If you'd like contribute a fix or a feature, that would be even better. Please make sure all pull requests are accompanied by tests, though. | ||
|
||
If you'd like to start work on a feature that is not part of the jQuery library, just raise an empty pull request and let's talk about it first - the goal here for this library to be a drop-in replacement for jQuery, with the same docs and API. | ||
|
||
###Support | ||
If you'd like to financially support the development of this library or just say thanks, you can send Bitcoin to `18TAaTamWaiv7cMK6FdbYeRzJUqBnECEah`. I'm also available to consult on how promises can improve your codebase - mail me at [email protected] | ||
|
||
###Usage with Zepto | ||
|
||
**Zepto now has a [deferred module](http://zeptojs.com/#modules) available, so you might want to use that if Zepto is your primary reason for using Simply Deferred.** | ||
|
||
Simply Deffered also acts as a plugin to [Zepto](http://zeptojs.com/). The absence of a Deferred library was one of the biggest reasons I've been holding back, so I thought it made sense to write one. Once you have both Zepto and Simply Deferred on your page, just do `Deferred.installInto(Zepto)` to set it up. The installation makes the following changes to bring it closer to jQuery: | ||
|
||
* Aliases the `Deferred` constructor to `$.Deferred`. | ||
* Aliases the `when` method to `$.when`. | ||
* Wraps `$.ajax` to return a `promise`, which has only the following methods: `state()`, `done()`, `fail()` and `always()`. The arguments passed to the `done` and `fail` callbacks are the same ones passed to the `success` and `error` options. | ||
|
||
###Collaborating | ||
Please feel free to raise issues on github.com/sudhirj/simply-deferred/issues - both obvious bugs or incompatibilities with jQuery are welcome. | ||
|
||
If you'd like contribute a fix or a feature, that would be even better. Please make sure all pull requests are accompanied by tests, though. | ||
|
||
If you'd like to start work on a feature that is not part of the jQuery library, let's talk about it first - the goal here for this library to be a drop in replacement for jQuery, with the same docs and API. | ||
|
||
###Support | ||
If you'd like to financially support the development of this library or just say thanks, you can send Bitcoin to `18TAaTamWaiv7cMK6FdbYeRzJUqBnECEah`. I'm also available to consult on how promises can improve your codebase - mail me at [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"author": "Sudhir Jonathan <[email protected]> (http://www.sudhirjonathan.com)", | ||
"name": "simply-deferred", | ||
"description": "A deferred library for Node.js and the browser with a simplified jQuery compatible API", | ||
"version": "2.4.0", | ||
"version": "3.0.0", | ||
"homepage": "http://sudhirj.github.com/simply-deferred/", | ||
"repository": { | ||
"type": "git", | ||
|