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

124
Views
Agregar consultas Dexie.js en el archivo JavaScript da una pista de tipo faltante

Si agrego una consulta Dexie.js en un archivo JavaScript como:

 let friends = liveQuery(async () => { return await db.friends .where("age") .between(18, 65) .toArray(); });

Recibo una pista como esta:

"La propiedad 'amigos' no existe en el tipo 'Dexie'.ts(2339)"

¿Por qué?

Ponerlo en un archivo Svelte está bien, pero me gustaría mantener algunas consultas básicas en un solo lugar, como buscar, agregar y eliminar.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Supongo que te refieres a un error de TypeScript. Si no está subclasificando a Dexie como se sugiere en el tutorial Svelte de Dexie , no puede usar db.friends directamente sin que TypeScript se queje. Si no desea crear una subclase de Dexie, también puede usar el método table() :

 let friends = liveQuery(async () => { return await db.table('friends') .where("age") .between(18, 65) .toArray(); });
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!