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

119
Views
¿Cómo agrego elementos en lugar de configurar con la API de almacenamiento de extensión web?

Estoy tratando de hacer un sistema reciente en el que, cuando vas a una identificación de un elemento, almacena cuando fuiste a esa identificación, algo similar a esto:

 chrome.storage.local.set({ [variable of id]: { recentTime: new Date(), anotherVariable: "hello world" }});

El problema es que quiero almacenar 2 instancias de historial, entonces quiero agregar otra como esta, aquí es donde aparece el problema, las claves anteriores desaparecieron, ya que es un conjunto (), no un complemento ()

 chrome.storage.local.set({ [variable of id]: { recentTime2: new Date(), anotherVariable2: "hello world" }});

sin embargo, puedo arreglar esto usando chrome.storage.local.get() y haciendo Object.assign() con ambas variables al configurar, esto es un poco complicado y no es muy eficiente, pero está bien, puedo manejarlo eso.

pero qué pasa si necesito hacer en los objetos, algo con una ruta más larga como esta:

 chrome.storage.local.set({ something: { // there is a variable here in the storage something: { // there is a variable here in the storage again something: "a" } } });

Y así se convierte en una gran molestia y se convierte en algo difícil de tratar. Potencialmente podría hacer una función que pueda hacer esto automáticamente, pero eso es muy difícil para mí.

¿Hay alguna otra manera eficiente de hacer esto?

about 4 years ago · Juan Pablo Isaza
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!