Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda