Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
Typescript support for async.auto in async.js library

How do we strongly type each of the async auto tasks? let's say get_data returns a number and email_link returns a string and I finally want to return the email_link task. I am unable to figure out how to strongly type each of those tasks and the result value.

async () => {
try {
    let results = await async.auto({
        get_data: async function() {
            // async code to get some data
            return someNumber;
        },
        make_folder: async function () {
            // async code to create a directory to store a file in
            // this is run at the same time as getting the data
           return something;
        },

        email_link: ['write_file', async function() {
            // once the file is written let's email a link to it...
            return someString;
        }]
    });
    console.log('results = ', results);
   return results.email_link;
}
catch (err) {
    console.log(err);
}

}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda