I hereby claim:
- I am mhm13dev on github.
- I am mhm13dev (https://keybase.io/mhm13dev) on keybase.
- I have a public key ASBOojcYrzhO0akkcDGxpym4H5RY7GX8aL7J62Aqmczz6wo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Read this article:
https://www.freecodecamp.org/news/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca/
For questions, comment below!
// for multiple requests | |
let isRefreshing = false; | |
let failedQueue = []; | |
const processQueue = (error, token = null) => { | |
failedQueue.forEach(prom => { | |
if (error) { | |
prom.reject(error); | |
} else { | |
prom.resolve(token); |
Promises and observables are both mechanisms used in JavaScript for handling asynchronous operations, but they have different characteristics and usage patterns.
Promises:
new Promise()
constructor, taking a function with resolve
and reject
parameters..then()
and .catch()
methods..then()
is used to handle the resolved value, and .catch()
is used to catch any errors.