Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

278
Vistas
NgRx - multiple dispatching causes the browser to stop responding. How to update multiple elements each second withouth performance issues?

in my applications i'm using Pixi.js for drawing a map with multiple elements. Each second the positions of these elements is updated, the problem is that every time position is updated the elemenet is created from scratch (component is destroyed) but I need to have a previous value of position to make some calculations. So I wanted to add such a state to the store but to have them there I need to dispatch them. So for example 30 elements are created at the same time every second, and at the same time all of them are dispatched. It's breaking the application. Do you have any advice on how to store this data differently so as not to cause performance problems?

This is my reducer method:

function updateRotation(state: State, callSing: string, rotation: number): State {
  const newState = cloneDeep(state);
  if (!newState.elementRotation) {
    newState.elementRotation= {};
  }
  newState.elementRotation[callSing] = rotation;
  return newState;
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If your item is big, that cloneDeep might slow down your performance. You don't need it.

function updateRotation(state: State, callSing: string, rotation: number): State {
  return {
    ...state,
    rotation: {
      ...state.rotation,
      [callSing]: rotation
    }
  }
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda