1👍
✅
You can use async-await
in your getCartContent()
method.
Like so:
async getCartContent() {
let token = await this.getValidToken();
let requestHeader = {
Authorization: "Bearer " + token
};
This will make sure that your requestHeader
will have token before it executes that line.
Source:stackexchange.com