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

114
Views
Pase el argumento a la tienda legible en Svelte

¿Hay alguna forma de pasar un argumento a la tienda legible en svelte? Tengo el siguiente código:

 export const worker = readable( [], async (set) => { const response = await fetchAPI() set(response) const interval = setInterval(async () => { const response = await fetchAPI() set(response) }, 10000) })

Quiero pasar un argumento a esa función legible con la respuesta de la API para establecer el resultado mediante set().

Gracias

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede acceder a cualquier variable que esté dentro del alcance, por lo que puede "pasar" una variable desde fuera de la función de readable .

 export function worker(arg) { return readable([], async set => { const response = await fetchAPI(arg); // arg is in scope here // ... }); }
about 4 years ago · Santiago Trujillo 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!