Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atoms() subscribed atom reactive is slower than expected #2

Open
rankun203 opened this issue Mar 24, 2021 · 1 comment
Open

atoms() subscribed atom reactive is slower than expected #2

rankun203 opened this issue Mar 24, 2021 · 1 comment

Comments

@rankun203
Copy link
Contributor

rankun203 commented Mar 24, 2021

As you can see from the screenshot, after we updated the var filterSortingDataLoading, it actually took a few rounds for it to get updated to the component, in this particular case, the API has already returned by the time the watched filterSortingDataLoading reacts.

Since we are using this for loading status and conditionally render view, we are thinking if we can make it faster.

@rankun203
Copy link
Contributor Author

rankun203 commented Mar 28, 2021

write(updateFilterSortingDataLoading, true) happened before wx.nextTick() and all the loadSearchFilter(), requestWithRetry()

The actual updateFilterSortingDataLoading and setData() happened inside / after.

So it's the timing wx.nextTick(cb) got called caused the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant