How to use the @instructure/debounce function in @instructure/debounce

To help you get started, we’ve selected a few @instructure/debounce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instructure / instructure-ui / packages / ui-test-utils / src / utils / waitForQueryResult.js View on Github external
return new Promise((resolve, reject) => {
    const debouncedQuery = debounce(runQuery, 10, { leading: false, trailing: true })

    let lastError, observer, timer, lastResult

    lastResult = {}

    function runQuery () {
      if (typeof queryFn !== 'function') {
        lastResult = {
          results: [],
          selector: JSON.stringify(queryFn)
        }
        onDone(new Error([
          '[ui-test-utils] Invalid element query function.',
          lastResult.selector
        ].join('\n')), lastResult)
        return

@instructure/debounce

A debounce util made by Instructure Inc.

MIT
Latest version published 2 days ago

Package Health Score

87 / 100
Full package analysis

Popular @instructure/debounce functions

Similar packages