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

184
Vistas
What do the typscript parameters between {} mean?

In the following piece of typescript code I don't understand why the data parameter is between curly brackets and why it has a : followed by the same data object with a type specification. What does this mean?

addArrivingTruckSuggestions(state: ITruckState, { data }: { data: IOperationalTruck[] }) {
        state.arrivingTruckSuggestions = searchService.createTruckSuggestions(data);
    }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This function has two parameters, state, and an object containing data.

The state object has a type of ITruckState. Straight forward enough.

The next parameter must be an object, but the only property this function cares about is data. This is why there are curly braces around data, it is being destructured from the wrapper object that is passed in. The second set of curly braces is to define datas type. It is wrapped in curly braces because only the data property is given a type.

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