mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-09 03:30:09 +00:00
added _(...).after definition
This commit is contained in:
@@ -413,8 +413,9 @@ result = <IStoogesCombined[]>_.where(stoogesCombined, { 'quotes': ['Poifect!'] }
|
||||
*************/
|
||||
var saves = ['profile', 'settings'];
|
||||
var asyncSave = (obj) => obj.done();
|
||||
var done: Function;
|
||||
|
||||
var done: Function = _.after(saves.length, function() {
|
||||
done = _.after(saves.length, function() {
|
||||
console.log('Done saving!');
|
||||
});
|
||||
|
||||
@@ -422,6 +423,14 @@ _.forEach(saves, function(type) {
|
||||
asyncSave({ 'type': type, 'complete': done });
|
||||
});
|
||||
|
||||
done = _(function() {
|
||||
console.log('Done saving!');
|
||||
}).after(saves.length);
|
||||
|
||||
_.forEach(saves, function(type) {
|
||||
asyncSave({ 'type': type, 'complete': done });
|
||||
});
|
||||
|
||||
var funcBind = function (greeting) { return greeting + ' ' + this.name };
|
||||
// need a second var otherwise typescript thinks func signature is the above func type,
|
||||
// instead of the newly returned _bind => func type.
|
||||
|
||||
7
lodash/lodash.d.ts
vendored
7
lodash/lodash.d.ts
vendored
@@ -1880,6 +1880,13 @@ declare module _ {
|
||||
n: number,
|
||||
func: Function): Function;
|
||||
|
||||
interface LoDashWrapper<T> {
|
||||
/**
|
||||
* @see _.after
|
||||
**/
|
||||
after(n: number): Function;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that, when called, invokes func with the this binding of thisArg
|
||||
* and prepends any additional bind arguments to those provided to the bound function.
|
||||
|
||||
Reference in New Issue
Block a user