mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
Bump to v3.9.0.
This commit is contained in:
@@ -10,12 +10,13 @@ define(['../lang/isObject', '../date/now'], function(isObject, now) {
|
||||
var nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* Creates a function that delays invoking `func` until after `wait` milliseconds
|
||||
* have elapsed since the last time it was invoked. The created function comes
|
||||
* with a `cancel` method to cancel delayed invocations. Provide an options
|
||||
* object to indicate that `func` should be invoked on the leading and/or
|
||||
* trailing edge of the `wait` timeout. Subsequent calls to the debounced
|
||||
* function return the result of the last `func` invocation.
|
||||
* Creates a debounced function that delays invoking `func` until after `wait`
|
||||
* milliseconds have elapsed since the last time the debounced function was
|
||||
* invoked. The debounced function comes with a `cancel` method to cancel
|
||||
* delayed invocations. Provide an options object to indicate that `func`
|
||||
* should be invoked on the leading and/or trailing edge of the `wait` timeout.
|
||||
* Subsequent calls to the debounced function return the result of the last
|
||||
* `func` invocation.
|
||||
*
|
||||
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
|
||||
* on the trailing edge of the timeout only if the the debounced function is
|
||||
|
||||
@@ -60,14 +60,14 @@ define(['../internal/MapCache'], function(MapCache) {
|
||||
}
|
||||
var memoized = function() {
|
||||
var args = arguments,
|
||||
cache = memoized.cache,
|
||||
key = resolver ? resolver.apply(this, args) : args[0];
|
||||
key = resolver ? resolver.apply(this, args) : args[0],
|
||||
cache = memoized.cache;
|
||||
|
||||
if (cache.has(key)) {
|
||||
return cache.get(key);
|
||||
}
|
||||
var result = func.apply(this, args);
|
||||
cache.set(key, result);
|
||||
memoized.cache = cache.set(key, result);
|
||||
return result;
|
||||
};
|
||||
memoized.cache = new memoize.Cache;
|
||||
|
||||
@@ -11,12 +11,12 @@ define(['./debounce', '../lang/isObject'], function(debounce, isObject) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a function that only invokes `func` at most once per every `wait`
|
||||
* milliseconds. The created function comes with a `cancel` method to cancel
|
||||
* delayed invocations. Provide an options object to indicate that `func`
|
||||
* should be invoked on the leading and/or trailing edge of the `wait` timeout.
|
||||
* Subsequent calls to the throttled function return the result of the last
|
||||
* `func` call.
|
||||
* Creates a throttled function that only invokes `func` at most once per
|
||||
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
||||
* method to cancel delayed invocations. Provide an options object to indicate
|
||||
* that `func` should be invoked on the leading and/or trailing edge of the
|
||||
* `wait` timeout. Subsequent calls to the throttled function return the
|
||||
* result of the last `func` call.
|
||||
*
|
||||
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
|
||||
* on the trailing edge of the timeout only if the the throttled function is
|
||||
|
||||
Reference in New Issue
Block a user