How to use the kew.isPromiseLike function in kew

To help you get started, we’ve selected a few kew 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 Medium / shepherd / lib / Builder.js View on Github external
} catch (e) {
        err = e
      }
    }

    if (err && !quietErr && node.errorFn) {
      try {
        node.errorFn(err, args)
      } catch (recursiveErr) {
        // swallow any errors during error handling,
        // and just propagate the original error
        console.warn(recursiveErr, data.getDebugContext(node))
      }
    }

    if (result && Q.isPromiseLike(result)) {
      Q.resolve(result)
        .thenBound(onSuccess, null, data)
        .failBound(onError, null, data)
        .thenBound(onComplete, null, data)
      return
    }

    // onSuccess throws if there's a Shepherd type error
    try {
      if (!err) onSuccess(data, result)
    } catch (e) {
      err = e
    }

    if (err) onError(data, err)
    onComplete(data, result)

kew

a lightweight promise library for node

Apache-2.0
Latest version published 9 years ago

Package Health Score

59 / 100
Full package analysis