Skip to content

Is there any api to know if the data is being filtered or sorted ? #5922

Answered by riccardoperra
MHRoni-dev asked this question in Q&A
Discussion options

You must be logged in to vote

Client-side filtering/sorting is sync, there is not really a pending state. You may are able to emulate a loading state via chrome-only api postTask or using raf/setTimeout/queueMicrotask. However since this still happen in main-thread depending on how slow the function is, the ui will be blocked (depending on how much data to render you have you'll notice it with a simple typehead, you may have to bind for example the change event for filtering)

If you are filtering/sorting remote data with a backend, you can handle the pending state from your app state side

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MHRoni-dev
Comment options

@riccardoperra
Comment options

Answer selected by MHRoni-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants