阅读背景:

在react-native中处理多个api调用

来源:互联网 

I am trying to implement a search field what happens here is whenever user enters text i text field the timer is reset to 300 ms and then an api call(search) is sent to fetch autocomplete results now after receiving those results the app waits for another 1s and sends another request. during this duration the user may enter some more text. So one scenario which I am assuming is that the search api is called and before the response arrives user changes the text sending another pre search call now the response for search arrives and is mistaken for pre search response and hence gives the error. Is there any workaround to this?I am trying to implement a search field what ha




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: