How to use the web3-core-promievent.apply function in web3-core-promievent

To help you get started, we’ve selected a few web3-core-promievent 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 trufflesuite / truffle / packages / contract / lib / promievent.js View on Github external
function PromiEvent() {
  const { resolve, reject, eventEmitter } = Web3PromiEvent.apply(
    null,
    arguments
  );

  const originalStackTrace = new Error().stack;

  function rejectHijacker(e) {
    try {
      const stackTrace = originalStackTrace.replace(
        /^Error: \n/,
        e.stack.split("\n")[0]
      );

      e.hijackedStack = e.stack;
      e.stack = stackTrace;
    } catch (_) {

web3-core-promievent

This package extends the EventEmitter with the Promise class to allow chaining as well as multiple final states of a function.

LGPL-3.0
Latest version published 1 year ago

Package Health Score

65 / 100
Full package analysis

Similar packages