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

250
Views
¿Cuál es la mejor manera de borrar completamente un elemento DOM para usarlo en un grupo?

Estoy considerando usar la agrupación de objetos de nodos DOM. Cuando se termine de usar un nodo DOM, se colocará en un grupo. Tengo algo como esto actualmente.

 function removeNativeElement(virtualElement, store) { let stack = [virtualElement] let els = [] while (stack.length) { const node = stack.shift() const el = node.nativeElement // remove from parent el.parentNode.removeChild(el) // remove event listeners node.handlers.forEach(({ type, handler }) => { el.removeEventListener(type, handler) }) el.children.forEach(child => { stack.push(child) }) els.push(el) } els.forEach(el => { // clear out any remaining text el.innerHTML = '' addNativeElementToPool(el) }) } function addNativeElementToPool(el, store) { const pool = store.pool[el.tagName] = store.pool[el.tagName] || [] if (pool.length > store.maxPoolSize) { return } pool.push(el) }

Pero, ¿qué pasa con el restablecimiento de los attributes y las propiedades de style de una manera eficiente? ¿Cómo se hace eso? El objetivo es hacer que colocar un objeto en una piscina no sea excesivamente costoso.

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!