Commit 01e9e1d516a0bcf09d486425ab7cba0f919f5a1a
Merge pull request #17 from dominictarr/patch-4
document mutant/once-idleMatt McKegg authored on 8/7/2017, 7:23:24 AM
GitHub committed on 8/7/2017, 7:23:24 AM
Parent: 1aafd09e523fdb479815d832932868b6130cc2be
Parent: 149f6bea0b174eebfb9243bd4b94384adb0ac740
Files changed
README.md | changed |
README.md | ||
---|---|---|
@@ -391,11 +391,19 @@ | ||
391 | 391 … | |
392 | 392 … | |
393 | 393 … | ### onceIdle |
394 | 394 … | |
395 | -... | |
395 … | +delay a function until the next [idle callback](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback) | |
396 … | +without hammering the `requestIdleCallback` api | |
396 | 397 … | |
398 … | +``` js | |
399 … | +var onceIdle = require('mutant/once-idle') | |
400 … | +onceIdle(function () { | |
401 … | + //called once, at some later point (after rendering and such) | |
402 … | +}) | |
403 … | +``` | |
397 | 404 … | |
405 … | + | |
398 | 406 … | ### resolve |
399 | 407 … | |
400 | 408 … | ... |
401 | 409 … |
Built with git-ssb-web