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

168
Views
¿Cuál es la mejor práctica para exportar un valor asíncrono en JavaScript?

En el fragmento de código a continuación, intento exportar un valor que se basa en operaciones asíncronas. ¿Es esta la mejor manera de hacerlo? Se siente un poco raro.

¡Me encantaría cualquier sugerencia! ¡Gracias!

 import ohm from "ohm-js"; export default await (async () => { let response = await fetch("./grammar.ohm"); let source = await response.text(); return ohm.grammar(source); })();
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No necesitas el asíncrono IIFE :

 import ohm from "ohm-js"; let response = await fetch("./grammar.ohm"); let source = await response.text(); export default await ohm.grammar(source);
about 4 years ago · Juan Pablo Isaza Report
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!