mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added definition and test for when.unfold
This commit is contained in:
@@ -116,6 +116,14 @@ when.iterate(function (x) {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
when.unfold(function (x) {
|
||||
return [{foo: 'bar'}, x + 1];
|
||||
}, function (x) {
|
||||
return x < 10;
|
||||
}, function (y) {
|
||||
delete y.foo;
|
||||
}, 0);
|
||||
|
||||
/* when.promise(resolver) */
|
||||
|
||||
promise = when.promise<number>(resolve => resolve(5));
|
||||
|
||||
Reference in New Issue
Block a user