Skip to content

Commit

Permalink
refactor: rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Aug 21, 2022
1 parent 04d0ae0 commit 26f61a4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class InProcessRunner {

let callback

const callbackCalled = new Promise((res, rej) => {
const callbackWrapper = new Promise((res, rej) => {
callback = (err, data) => {
if (err === 'Unauthorized') {
res('Unauthorized')
Expand Down Expand Up @@ -94,13 +94,13 @@ export default class InProcessRunner {
// throw new Error(`Synchronous function execution is not supported.`)
// }

const callbacks = [callbackCalled]
const responses = [callbackWrapper]

// Promise was returned
if (result != null && typeof result.then === 'function') {
callbacks.push(result)
responses.push(result)
}

return Promise.race(callbacks)
return Promise.race(responses)
}
}

0 comments on commit 26f61a4

Please sign in to comment.