Approach to temporary freeze sorting (but, still, updating data) #2626
Unanswered
lorenzosfarra
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to ask your opinion on the best approach to create the following scenario:
useTable
hook:And everything seems to work fine: I have my data updated when something new comes, and my table gets re-ordered according to the sorting algorithm.
All good.
Now, my client has a specific feature request: I have to "freeze" the rows re-ordering for 15 seconds, but I still need to update the rendered data in the existing rows.
So basically the re-ordering has to happen every X>=15s.
Ex.:
Let's say that at T0 I have the following scenario, in which I am ordering (DESC) the rows based on their value:
After 5 seconds, at T1 (< T0 + 15s), I receive new data from the server: the value of row 2 is now
25
, so is larger than row 1. For the sorting algorithm, now the table becomes:But what I would like to have (because of the 15 seconds rule) is:
T2 comes, 15 seconds are now passed from T0. A re-render is required, and now my table should be:
Do you have an idea on how to approach this problem?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions