Permalink
Browse files

Add info on how to instantiate Promised.

  • Loading branch information...
1 parent c639f0f commit 061794391ab016dbe317039475512a0c94903450 @vic committed Aug 25, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 README.md
View
@@ -8,6 +8,26 @@ Currently it supports jQuery and Q promises.
[jQuery]: [http://api.jquery.com/category/deferred-object]
[Q]: [http://documentup.com/kriskowal/q/]
+## Usage ##
+
+```javascript
+var P = require('promised') // or window.promised in browsers
+
+var promisedQ = P.Q( Q ) // Use Promised with Q deferreds
+var promisedJ = P.$( jQuery ) // Use Promised with JQuery deferreds
+
+// Or you can give P two functions:
+//
+// deferrer: takes a single argument and creates a deferred object
+// with it or returns it if already a referred.
+//
+// promiser: takes a deferred object and returns a promise for it
+//
+
+var promisedCustom = P( defferer, promiser )
+
+```
+
## API ##
In the following signatures `callback<e,s>` means a function that

0 comments on commit 0617943

Please sign in to comment.