You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if it works (sets pagination config to {... buttonsCount: 2, nextButton: true}:
sometimes the data() callback gets called again -> thus making a second, identical request to the server
sometimes this happens even three times
if it does not work (all items fetched, no pagination)
data() is called the first time: it sets the correct pagination config and issues a request
then the data() method gets called again and has the wrong ServerStorageOptions.url (missing the pagination params) -> thus it sets the wrong pagination config = {... buttonsCount: 0, nextButton: false}
if I set a break point on the first line in the data() handler, this case does not happen anymore which leads me to believe some kind of race condition is happening
I ask myself if calling updateConfig() in requestAnimationFrame() is officially supported ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to:
So, inside the
Config.server.data
method I callupdateConfig()
:This works, 95% of the time. However:
{... buttonsCount: 2, nextButton: true}
:data()
callback gets called again -> thus making a second, identical request to the serverdata()
is called the first time: it sets the correct pagination config and issues a requestdata()
method gets called again and has the wrongServerStorageOptions.url
(missing the pagination params) -> thus it sets the wrong pagination config ={... buttonsCount: 0, nextButton: false}
data()
handler, this case does not happen anymore which leads me to believe some kind of race condition is happeningI ask myself if calling
updateConfig()
inrequestAnimationFrame()
is officially supported ?Beta Was this translation helpful? Give feedback.
All reactions