4 ms·
So now to get really deep/meta, you'll want to combine with promisify: var isTrue = require('callbaxx').isTrue; var promisify = require('promisify');
by jtokoph 8y ago
So now to get really deep/meta, you'll want to combine with promisify:
var isTrue = require('callbaxx').isTrue;
var promisify = require('promisify');
var promIsTrue = promisify(isTrue);
promIsTrue(true)
.then(function (res) {
console.log(res)
});
.catch(function (err) {
console.log(err)
});
- scottmf 8y agoHi! That's definitely an interesting experiment, but it's rather antithetical to the project. In fact, it might even be broken by future versions of the library. See issue #7 [1] for a look at why this might not be a good idea. Thanks anyway! 1. https://github.com/scf4/callbaxx/issues/7 https://github.com/scf4/callbaxx/issues/7
- jcolella 8y ago@jtokoph, maybe this can be put in the examples for the `callbaxx-promise` library that will be surely be created after.
- leetbulb 8y agoWe must go deeper! const promisify = require('bluebird').promisify const from = require('rxjs').from const isTrue = require('callbaxx').isTrue const isTrueAsync = promisify(isTrue) const makeIsTrueSource = val => from(isTrueAsync(val)) const source = makeIsTrueSource(true) source.subscribe(console.log, console.error)
- z3t4 8y agoA few more abstractions and it will meet enterprise compliance. Probably need to write it as a Class ...