Permalink
Browse files

README

  • Loading branch information...
nrstott committed Dec 9, 2011
1 parent 92f883e commit a2064689074510182bb34111acd73bf89d3fd89e
Showing with 6 additions and 2 deletions.
  1. +6 −2 README.md
View
@@ -351,8 +351,8 @@ Bubbling errbacks is paralell to having a try/catch at a higher level handle err
### Working with Node.JS Callbacks
-Node.JS uses a style of callback with the following signuare: `function(err, result)`. Bogart includes a utility function
-to adapt these Node.JS-style functions to return a Promise.
+Node.JS uses a style of callback with the following signuare: `function(err, result)`. Bogart includes a utility function,
+`bogart.promisify`, to adapt these Node.JS-style functions to return a Promise.
var fs = require('fs'); // Node File System Module
var bogart = require('bogart'); // Include Bogart
@@ -364,6 +364,10 @@ to adapt these Node.JS-style functions to return a Promise.
console.log(data);
});
+*NOTE*: A Node.JS-style function which calls its callback multiple times is not compatible with promises.
+A Promise may be resolved only once. Node.JS style functions that call their callback multiple times are
+uncommon. The vast majority of Node.JS style functions can be safely translated using `bogart.promisify`.
+
### Promises are 'A Good Thing'
There are a lot of critiques of Promises. These usually come from programmers who have not used a proper Promise library.

0 comments on commit a206468

Please sign in to comment.