10 examples of 'bluebird reject' in JavaScript

Every line of 'bluebird reject' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
92function rejectPromise(e) {
93 return reject(e);
94}
Important

Use secure code every time

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

47reject (reason) {
48 if (this.state !== STATE_PENDING) {
49 return;
50 }
51
52 this.state = STATE_REJECTED;
53 this.v = reason;
54
55 if (this.clients) {
56 setImmediate(e => {
57 this.clients.forEach(client => reject(client, reason));
58 });
59 }
60}
50reject(reason?: any) {
51 this.internalState = 'rejected';
52 this.promiseReject(reason);
53}
219function promiseReject (reason) {
220 self._handler.reject(reason);
221}
160Promise.reject = function reject() {
161 var retVal = new Promise(function (r, j) { });
162 var args = [];
163 for (var i in arguments) {
164 args.push(arguments[i]);
165 }
166 retVal._internal.rejector.apply(retVal._internal, args);
167 return (retVal);
168};
22function reject(reason) {
23 function rejected(op, arg1, arg2, arg3) {
24 if (undefined === op) { return rejected; }
25 if ('WHEN' === op) { return arg2 ? arg2(reason) : reject(reason); }
26 return arg1 ? arg1(reject(reason)) : reject(reason);
27 }
28 rejected.reason = reason;
29 rejected.isPromise___ = true;
30 return rejected;
31}
19export function handlePromiseRejection(promise) {
20 return promise.then(null, () => { /* swallow */ });
21}
162return new Promise(function promiseFn(resolve, reject) {
163 resolve(response);
164 reject('mock request failed');
165});
212function failure(err) {
213 reject(err);
214}
20Q.reject = function reject(reason) {
21 return Promise.reject(reason);
22};

Related snippets