Hi!
I want to understand how to use the Deferrable module from JSClass.
The context where I am working is an action to create a User in a Redis hash:
1. Increase counter to get ID
2. Set Redis hash of user with ID
3. Return created user from Redis
I now have:
var incrId = function() {
var promise = new Promise();
client.hincrby('users', 'count', 1, function(err, id){
promise.succeed(addUser);
});
return promise;
};
var addUser = function() {
// never gets called
};
incrId(); // main call
Any ideas why the promise doesn't call addUser?
Thanks!