Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

77
Views
Promises returning pending

I'm having slight issues with promises in typescript where the results is always pending, even though it's been fulfilled.

I have this function in a utils folder that processes endpoints from another file, which all run on promises

utils folder function

export const GetData = async (
    xx: string[],
    endpointOne: boolean,
) => {
    if (endpointOne) {
        return getDataFromEndpointOne(xx)
    } 

    return getDataFromEndpointTwo(xx)
}

example of endpoint

const getDataFromEndpointOne = (
    xx: string[],
): Promise<any> =>
    Request(
        `/endpoint1/${xx}`,
    );

But in the main folder that's calling the utils folder function, it always (always) returns pending no matter what I try

const data =
    getData(
        ["1", "3", "56"],
        true
    ).then(result => { return result })
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!