Skip to content

Commit

Permalink
Releasing 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhirj committed Jan 5, 2014
1 parent 2864d89 commit 96d5e24
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 20 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.1.0
2 changes: 1 addition & 1 deletion Procfile
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
33 changes: 19 additions & 14 deletions README.md
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()`
Expand All @@ -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 sudhir.j+github@gmail.com

###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 sudhir.j+github@gmail.com
2 changes: 1 addition & 1 deletion deferred.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ####[Source (github)](http://github.com/sudhirj/simply-deferred) | [Documentation](https://github.com/sudhirj/simply-deferred#simply-deferred)
# © Sudhir Jonathan [sudhirjonathan.com](http://www.sudhirjonathan.com)

VERSION = '2.4.0'
VERSION = '3.0.0'

# First, let's set up the constants that we'll need to signify the state of the `deferred` object. These will be returned from the `state()` method.

Expand Down
2 changes: 1 addition & 1 deletion deferred.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deferred.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deferred_test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe 'deferred', ->

it 'should run additional progress callbacks with the last sent notify arguments', (done) ->
def = new deferred.Deferred();
callback = _.after 3, (arg1) ->
callback = _.after 3, (arg1) ->
if arg1 is 2
done()
def.progress(callback)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Sudhir Jonathan <contact.me@sudhirjonathan.com> (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",
Expand Down

0 comments on commit 96d5e24

Please sign in to comment.