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

121
Vistas
uso de la función de rebote de lodash

Estoy usando una función de rebote en mi proyecto nativo de reacción . Se activa después de que el usuario ingresa 3 caracteres, pero se activa después de 2 segundos en lugar del retraso i le asigné.

 constructor() { this.init() this.hitSearchApi = debounce(() => { log('inside if is called debounce') this.getStudentTableData(() => this.updateFetchingStatus(true)) this.updateSearchLoaderStatus(false) this.updateFetchingStatus(false) }, 100) }

Creé mi función de rebote dentro del constructor de la tienda de esta manera.

 @action onChangeSearchText = (searchText) => { if (get(searchText, 'length', 0) > 2) { log('inside search text if condition') this.updateSearchLoaderStatus(true) this.hitSearchApi.cancel() // this.updateSearchLoaderStatus(true) log('before hit search api') this.hitSearchApi() // fetch student list on search basis } else if (get(searchText, 'length') === 0) { this.setStudentListData({}) this.updateFetchingStatus(true) this.resetSearchData() } this.searchText = searchText }

Este es mi texto onChange activado, que se llama en el evento textinput onChange . Por favor, ayúdame en esto. ¿Qué estoy haciendo mal aquí?

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