3 ms·
Using async, if you want something to allow listeners to be attached later: var outcome = Boxon(); fs.readFile( "test.txt", outcome ); // Attach listener
by jhrobert 13y ago
Using async, if you want something to allow listeners to be attached later:
var outcome = Boxon();
fs.readFile( "test.txt", outcome );
// Attach listener later:
outcome( function( err, content ){ ... } );
See https://github.com/JeanHuguesRobert/l8/wiki/AboutBoxons https://github.com/JeanHuguesRobert/l8/wiki/AboutBoxons
Boxon objects are light compared to promises, but they interop well. Best of both worlds!