function not being called in the then section of Promise all
you shouldn't need the .then
call since you are using async/await:
try {
await Promise.all([
this.fetchDataFromExchange(timeframes[1],false),
this.fetchDataFromExchange(timeframes[2],false),
this.fetchDataFromExchange(timeframes[3],false),
this.fetchDataFromExchange(timeframes[4],false)
]);
this.createConfluenceSummaryTable()
} catch (e) {
// something failed, check `e`
}
Your .then(console.log())
is also not correct - you need to pass a function in .then
and not call it directly there: () => console.log(...)
.
Most likely one of your promises has an error which you can catch with a try/catch.
Web API not being called from angular
Looks like you are forgot to subscribe to:
this.stops$ = this.apiService.getStopStatistics(id);
this.list$ = this.apiService.getList(id, '3');
I think this.stops$ works for you because somewhere in the template you have async pipe(stops$ | async).
So try to do:
this.list$.subscribe(response => console.log(response));
after that request should sent
Function is not being called React native
The function setSTNo
is expecting a parameter serviceTData
which you are not passing down to it.
I'm guessing the serviceTData
is one of your useState items and you want to call the function setSTNo
whenever the serviceTData
value is updated.
If so,
- You can remove the
serviceTData
fromasync function setSTNo (serviceTData)
parameter list - Add a
useEffect
to listen for the changes in theserviceTData
item and then call the functionsetSTNo
whenever theserviceTData
is updated. - remove the
setSTNo
function call from your API call then block.
async function setSTNo () {
console.log("st No tryyy" )
try {
await AsyncStorage.setItem('STnumber', serviceTData.id);
setLaststNumber(serviceTData.id);
console.log("OLD st No" , LaststNumber);
} catch (e){
console.log("Error Part",e);
}
}
Then add a useEffect
to listen to your serviceTData
state.
useEffect(() => {
if(serviceTData)
setSTNo();
},[serviceTData]);
assuming the initial state of serviceTData
is null
.
Related Topics
Storyboard View Elements Greyed Out
Resize Textfield Based on Content
How to Check If a File Exists in Documents Folder
Since Xcode 8 and iOS10, Views Are Not Sized Properly on Viewdidlayoutsubviews
Implementing Google Custom Search API in iOS
How to Restrict Special Characters in Uitextfield Except Dot and Underscores
In Call Status Bar (Unable to Satisfy Constraints)
Offscreen Uitableviewcells (For Size Calculations) Not Respecting Size Class
Nscache Doesn't Work with All Images When Loading for the First Time
iOS - How to Play a Video with Transparency
Nsdateformatter Milliseconds Bug
Uicollectionview Spacing Margins
How to Change Text on a Back Button
iPhone Is Not Available. Please Reconnect the Device
Wrapping Text in a Uitextview Around a Uiimage Without Coretext