soliton4/promiseland

Callback

Closed this issue · 3 comments

You could make Callback return the .callback function itself, with a property .promise, no?

var callback = new Callback();
fs.readdir(".", callback);
var files = (*callback.promise)[1];

i have given this some thought and i apprechiate ppl getting involved.
the callback api is not final of course.

the problem is:
new Callback() would have to return a function. is this even possible?

the property .promise has to stay since i want the final promiseland internal promiseimplementation to be just a function.
there will be import and export functions for interacting with promiseland promises from the outside

it actually is possible
see new implementation of Callback
https://github.com/soliton4/promiseland/blob/master/promiseland.js#L163

@andreineculau i just updated the website.
lots of code examples now

http://promise-land.net/