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

170
Vistas
How to map a function result to a list if the function is async?

Javascript newbie here. I saw this: https://storybook.js.org/docs/react/configure/overview

// .storybook/main.js

function findStories() {
  // your custom logic returns a list of files
}

module.exports = {
  stories: async (list) => [...list, ...findStories()],
};

And I'm assuming the [...list, ...findStories()] maps an array result from findStories() into list, but how would I get it to work if findStories() was an async function and I needed to await the Promise that findStories() returned? Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

if findStories be an async function you can do it like this:

module.exports = {
  stories: async (list) => [...list, ...(await findStories())],
};
about 4 years ago · Juan Pablo Isaza Denunciar
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