this is not how promises work
const request = axios.get('....) .then(... { ... }) .catch(... { ... }); request.then(function (token) { console.log(token); });
This code will: * Start a request * console.log the value of token (some time later): * Request completes * token gets assigned
Обсуждают сегодня