How to use the @braintree/event-emitter.prototype function in @braintree/event-emitter

To help you get started, we’ve selected a few @braintree/event-emitter 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 braintree / braintree-web / test / hosted-fields / unit / external / hosted-fields.js View on Github external
instance.teardown(function () {
        methods(HostedFields.prototype).concat(methods(EventEmitter.prototype))
          .forEach(function (method) {
            var error;

            try {
              instance[method]();
            } catch (err) {
              error = err;
            }

            expect(error).to.be.an.instanceof(BraintreeError);
            expect(error.type).to.equal(BraintreeError.types.MERCHANT);
            expect(error.code).to.equal('METHOD_CALLED_AFTER_TEARDOWN');
            expect(error.message).to.equal(method + ' cannot be called after teardown.');
          });

        done();
github braintree / braintree-web / src / three-d-secure / external / three-d-secure.js View on Github external
ThreeDSecure.prototype.teardown = function () {
  var methodNames = methods(ThreeDSecure.prototype).concat(methods(EventEmitter.prototype));

  convertMethodsToError(this, methodNames);

  return this._framework.teardown();
};
github braintree / braintree-web / src / hosted-fields / external / hosted-fields.js View on Github external
this._destructor.registerFunctionForTeardown(function () {
    var methodNames = methods(HostedFields.prototype).concat(methods(EventEmitter.prototype));

    convertMethodsToError(self, methodNames);
  });
}

@braintree/event-emitter

A simple event emitter.

MIT
Latest version published 5 days ago

Package Health Score

74 / 100
Full package analysis