365体育足球滚球比分

Questions tagged [es6-promise]

365体育足球滚球比分 An ES6 Promise is an ECMAScript 2015 object that represents an in-progress asynchronous operation

Filter by
Sorted by
Tagged with
1
vote
2answers
20 views

awaiting an async function pauses execution even when the function immediately returns

I've recently ran into a problem that essentially boils down to the following code snippet: let a = 0; async function f1(){ // doesn't do anything most of the time } async function f2(){ ...
0
votes
0answers
24 views

Angular nested promises doesn't complete

I'm struggling with a consecutive/nested promises in my App. It's for authentication with Firebase but I believe(with what I read, still beginner though) that issue is how I'm nesting the promises and ...
-2
votes
1answer
46 views

Extract promise type passed as parameter

Hi I am trying to achieve this: if I have a function that gets as a parameter (a promise like as handleRequest(promise: Promise<any>) in my example), I want to specify the any type in order to ...
1
vote
3answers
35 views

How do I chain return values from async functions in ES 2017?

I'm trying to do this: service.getConfig() .then(cfg => service.getData()) .then(data => service.process(data,cfg)) .then(results => console.log(results)) .catch(err => console.log(err)); ...
-1
votes
3answers
28 views

How to handle errors for API calls in react using async/await

I'm looking for advice on how to handle errors in React while making API calls using async/await. const endpoint = `http://dataserice.accuweather.com/forecasts/v1/daily/5day/207931?apikey=...
1
vote
2answers
76 views

I am awaiting for a return Promise from a class method from a module i am creating and i get it, but in a weird context. How can i await it properly?

So I am creating a module with a class method(schedule) with async function awaiting the return //SCHEDULER.JS// class Schedule { constructor(project_id, queue_id) { this.project_id = ...
0
votes
0answers
21 views

React this.props.history.push stops working when I place it in a promise. Why?

When I call this function I get redirected to the page I request: submit = () => { if(!this.state.sell){ this.props.history.push({pathname: "/events"}) } else { ...
2
votes
1answer
43 views

how to output value from async method

I want to create a async method that returns an image path like this: const renderMasterThumb = async (masterAssetId) => { const masterAsset = await getAssetByIdAsync(masterAssetId); const ...
-4
votes
1answer
38 views

TypeScript How to access field in promise method [duplicate]

I am trying to access field in promise method. Here is the code: // Import stylesheets import './style.css'; export class User{ firstName:string; lastName:string; constructor(){ this....
0
votes
1answer
10 views

Upgrading Cloud function from Parse-server 2.0 to 3.0

I am in the middle of upgrading my Parse-server 2.0 Cloud functions to 3.0. One of the functions working in 2.0 is: Parse.Cloud.define("countOfObservations", function(request, response) { ...
1
vote
0answers
41 views

Why aren't array methods working within my .then() callback function? [duplicate]

I am trying to sort an array of GitHub commit dates that I am pulling from the GitHub API with an $.ajax request. I have successfully gotten the data I want, which is returned from my function in the ...
1
vote
1answer
48 views

How to Iterate Promise values and fill in the form?

I have a async function with return Fetch Request: async fetchDataByCodOS(codOS){ const res = await fetch( 'http://localhost:5000/cods/'+codOS, { method:"GET&...
1
vote
1answer
34 views

Images are not getting downloaded using promises [duplicate]

I need to download all images and generate word document with them. Using nodeJS and Meteor WebApp.connectHandlers.use('/download', async function (req, res, next) { // ... const images = []; ...
0
votes
0answers
43 views

Skip a promise chain if another chain is finished first

I'm using Node.js, I have two seperate promise chains happening parallelly, starting at the same time, one chain is a timer that loops 15 times (each loop sleeps 1 second, therefore it's 15 seconds ...
-3
votes
2answers
39 views

Different function call types with Promises

How do they differ in terms of execution order exception handling return values etc. getFromURL().then(function () { return callbackFunc(); }); getFromURL().then(function () { ...

15 30 50 per page
1
2 3 4 5
263