]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
docs: add doc for "tryInterval" test utility 11279/head
authorNicolas Coden <nicolas@ncoden.fr>
Fri, 18 May 2018 20:16:27 +0000 (22:16 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Fri, 18 May 2018 20:17:37 +0000 (22:17 +0200)
test/javascript/lib/utils.js

index 0f269834aa5f605a5f5cedd0eca12be601f74441..cb0e5aa2e4f657e3b716ab8694fe9044870c8ab3 100644 (file)
@@ -1,5 +1,14 @@
 (function (global, $) {
 
+  /**
+  * Try to catch the `do` function every `interval` delay, until it succedes
+  * (does not throw an error) or a given `timout` time passed.
+  * If a `then` function is passed, it is called after `do` succeded.
+  * If a `catch` function is passed, it is called after each time `do` fails.
+  *
+  * @param  {object} opts
+  * @param  {object} opts
+  */
   global.tryInterval = function (opts) {
     var _opts = $.extend({}, opts);
     var totalTime = 0;