diff --git a/index.html b/index.html index 83386bb5e..1d87bdd13 100644 --- a/index.html +++ b/index.html @@ -160,7 +160,7 @@ bind, bindAll, memoize, delay, defer, throttle, debounce, - wrap, compose + once, wrap, compose
@@ -738,6 +738,21 @@ $(window).scroll(throttled);
var lazyLayout = _.debounce(calculateLayout, 300); $(window).resize(lazyLayout); ++ +
+ once_.once(function)
+
+ Creates a version of the function that can only be called one time.
+ Repeated calls to the modified function will have no effect, returning
+ the value from the original call. Useful for initialization functions,
+ instead of having to set a boolean flag and then check it later.
+
+var initialize = _.once(createApplication); +initialize(); +initialize(); +// Application is only created once.