added _(...).createCallback def

This commit is contained in:
Brian Zengel
2013-10-21 00:40:27 -04:00
parent ff0358b638
commit 65e0a6a400
2 changed files with 14 additions and 2 deletions
+5 -2
View File
@@ -504,8 +504,11 @@ result = <Function>_.compose(greet, format);
result = <_.LoDashWrapper<Function>>_(greet).compose(format);
var createCallbackObj = { name: 'Joe' };
var pluckCallback: () => any = _.createCallback('name');
var whereCallback: () => boolean = _.createCallback(createCallbackObj);
result = <() => any>_.createCallback('name');
result = <() => boolean>_.createCallback(createCallbackObj);
result = <_.LoDashWrapper<() => any>>_('name').createCallback();
result = <_.LoDashWrapper<() => boolean>>_(createCallbackObj).createCallback();
var curried: Function = _.curry(function(a, b, c) {
console.log(a + b + c);
+9
View File
@@ -2058,6 +2058,15 @@ declare module _ {
thisArg?: any,
argCount?: number): () => boolean;
interface LoDashWrapper<T> {
/**
* @see _.createCallback
**/
createCallback(
thisArg?: any,
argCount?: number): LoDashWrapper<() => any>;
}
/**
* Creates a function which accepts one or more arguments of func that when invoked either
* executes func returning its result, if all func arguments have been provided, or returns