mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Bump to v3.3.0.
This commit is contained in:
@@ -19,7 +19,9 @@ define(['../internal/baseBindAll', '../internal/baseFlatten', '../object/functio
|
||||
*
|
||||
* var view = {
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* 'onClick': function() {
|
||||
* console.log('clicked ' + this.label);
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* _.bindAll(view);
|
||||
|
||||
@@ -12,7 +12,9 @@ define(['../internal/baseDelay'], function(baseDelay) {
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* _.defer(function(text) { console.log(text); }, 'deferred');
|
||||
* _.defer(function(text) {
|
||||
* console.log(text);
|
||||
* }, 'deferred');
|
||||
* // logs 'deferred' after one or more milliseconds
|
||||
*/
|
||||
function defer(func) {
|
||||
|
||||
@@ -13,7 +13,9 @@ define(['../internal/baseDelay'], function(baseDelay) {
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* _.delay(function(text) { console.log(text); }, 1000, 'later');
|
||||
* _.delay(function(text) {
|
||||
* console.log(text);
|
||||
* }, 1000, 'later');
|
||||
* // => logs 'later' after one second
|
||||
*/
|
||||
function delay(func, wait) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../internal/arrayEvery', '../lang/isFunction'], function(arrayEvery, isFunction) {
|
||||
define(['../internal/arrayEvery', '../internal/baseIsFunction'], function(arrayEvery, baseIsFunction) {
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
@@ -34,7 +34,7 @@ define(['../internal/arrayEvery', '../lang/isFunction'], function(arrayEvery, is
|
||||
if (!length) {
|
||||
return function() { return arguments[0]; };
|
||||
}
|
||||
if (!arrayEvery(funcs, isFunction)) {
|
||||
if (!arrayEvery(funcs, baseIsFunction)) {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
return function() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['../internal/arrayEvery', '../lang/isFunction'], function(arrayEvery, isFunction) {
|
||||
define(['../internal/arrayEvery', '../internal/baseIsFunction'], function(arrayEvery, baseIsFunction) {
|
||||
|
||||
/** Used as the `TypeError` message for "Functions" methods. */
|
||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||
@@ -34,7 +34,7 @@ define(['../internal/arrayEvery', '../lang/isFunction'], function(arrayEvery, is
|
||||
if (fromIndex < 0) {
|
||||
return function() { return arguments[0]; };
|
||||
}
|
||||
if (!arrayEvery(funcs, isFunction)) {
|
||||
if (!arrayEvery(funcs, baseIsFunction)) {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
return function() {
|
||||
|
||||
@@ -26,7 +26,9 @@ define(['../internal/baseFlatten', '../internal/createWrapper'], function(baseFl
|
||||
* // => ['a', 'b', 'c']
|
||||
*
|
||||
* var map = _.rearg(_.map, [1, 0]);
|
||||
* map(function(n) { return n * 3; }, [1, 2, 3]);
|
||||
* map(function(n) {
|
||||
* return n * 3;
|
||||
* }, [1, 2, 3]);
|
||||
* // => [3, 6, 9]
|
||||
*/
|
||||
function rearg(func) {
|
||||
|
||||
@@ -42,8 +42,9 @@ define(['./debounce', '../lang/isObject'], function(debounce, isObject) {
|
||||
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
||||
*
|
||||
* // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
|
||||
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false })
|
||||
* jQuery('.interactive').on('click', throttled);
|
||||
* jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
|
||||
* 'trailing': false
|
||||
* }));
|
||||
*
|
||||
* // cancel a trailing throttled call
|
||||
* jQuery(window).on('popstate', throttled.cancel);
|
||||
|
||||
Reference in New Issue
Block a user