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

115
Views
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
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!