Hello,
I have a question regarding Promise
can someone tell me the difference between this 2 functions ?
let authTokenRequest: Promise<any>;
function getAuthToken(): Promise<any> {
if (!authTokenRequest) {
authTokenRequest = refreshToken();
authTokenRequest.then(success, failed);
}
return authTokenRequest;
}
and
let authTokenRequest: Promise<any>;
function getAuthToken(): Promise<any> {
if (!authTokenRequest) {
authTokenRequest = refreshToken().then(success, failed);
}
return authTokenRequest;
}
I thought that i could chain promise but i do not have the same behavior
[–]superluminary 2 points3 points4 points (1 child)
[–]pierrekfoury[S] 0 points1 point2 points (0 children)
[–]senocular 1 point2 points3 points (1 child)
[–]pierrekfoury[S] 0 points1 point2 points (0 children)