-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mixin lodash _.chain().value() not work #33
Comments
├─┬ [email protected] |
Thank you for the issue. I'll revert the changes, thanks 😄 |
THX, You did what I needed. |
@HoKangInfo |
const _ = require('lodash');
const Aigle = require('aigle');
Aigle.mixin(_);
function asyncFunc(n) {
return new Promise(resolve => setTimeout(resolve, 10, n * 2));
}
main=async function() {
// example 1
const array = [1, 2, 3];
const result_1 = await Aigle.map(array, asyncFunc);
// example 2
const result_2 = await Aigle.chain(array)
.map(asyncFunc)
.sum()
.value();
// or
const result_3 = await Aigle.resolve(array)
.map(asyncFunc)
.sum();
const result_4 = await Aigle.map(array, asyncFunc)
.sum();
console.log(result_1,result_2,result_3,result_4)
}()
// ==> [ 2, 4, 6 ] undefined 12 12
// should result_2 == result_4
├─┬ [email protected]
│ └── [email protected]
├── [email protected]
The text was updated successfully, but these errors were encountered: