We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54ed02e commit e164250Copy full SHA for e164250
assets/resources/run-at.js
@@ -26,7 +26,23 @@ import { safeSelf } from './safe-self.js';
26
27
/* eslint no-prototype-builtins: 0 */
28
29
-/******************************************************************************/
+/**
30
+ * @helperScriptlet run-at.fn
31
+ *
32
+ * @description
33
+ * Execute a function at a specific page-load milestone.
34
35
+ * @param fn
36
+ * The function to call.
37
38
+ * @param when
39
+ * An identifier which tells when the function should be executed.
40
+ * See <https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState>.
41
42
+ * @example
43
+ * `runAt(( ) => { start(); }, 'interactive')`
44
45
+ * */
46
47
export function runAt(fn, when) {
48
const intFromReadyState = state => {
0 commit comments