Skip to content

Commit

Permalink
Refactored pulled changes and bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhirj committed Oct 17, 2013
1 parent a5a7213 commit 8efd5a9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
16 changes: 5 additions & 11 deletions 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.3.0'
VERSION = '2.4.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 Expand Up @@ -83,16 +83,10 @@ Deferred = ->
master = new Deferred()

filter = (source, funnel, callback) ->
if callback?
candidate[source]((args...) ->
value = callback(args...)
if isPromise(value)
value.done(master.resolve).fail(master.reject)
else
master[funnel](value)
)
else
candidate[source](master[funnel])
if not callback then return candidate[source](master[funnel])
candidate[source] (args...) ->
value = callback(args...)
if isPromise(value) then value.done(master.resolve).fail(master.reject) else master[funnel](value)

filter('done', 'resolve', doneFilter)
filter('fail', 'reject', failFilter)
Expand Down
35 changes: 22 additions & 13 deletions 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 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.3.0",
"version": "2.4.0",
"homepage": "http://sudhirj.github.com/simply-deferred/",
"repository": {
"type": "git",
Expand Down

0 comments on commit 8efd5a9

Please sign in to comment.