Show loading state during revalidation of cache tag
Unanswered
Wesley Janse posted this in #help-forum
Hey, I’m searching for a way to track a transitions pending state to include the revalidation of a tag.
Currently the flow is as follows:
1. User updates the cart, for example quantity change. This is done via a server function and the state is tracked with a transition.
2. Within this server function we call revalidateTag to revalidate the users cart so all data is correctly updated.
3. During the transition we show a skeleton over the price row to indicate it’s recalculating the cart price and item prices.
4. The skeleton disappears before the cart is updated. This makes the UI less ideal.
Do you have any suggestions on how to tackle this without setting timeouts.
Currently the flow is as follows:
1. User updates the cart, for example quantity change. This is done via a server function and the state is tracked with a transition.
2. Within this server function we call revalidateTag to revalidate the users cart so all data is correctly updated.
3. During the transition we show a skeleton over the price row to indicate it’s recalculating the cart price and item prices.
4. The skeleton disappears before the cart is updated. This makes the UI less ideal.
Do you have any suggestions on how to tackle this without setting timeouts.
2 Replies
@Wesley Janse Hey, I’m searching for a way to track a transitions pending state to include the revalidation of a tag.
Currently the flow is as follows:
1. User updates the cart, for example quantity change. This is done via a server function and the state is tracked with a transition.
2. Within this server function we call revalidateTag to revalidate the users cart so all data is correctly updated.
3. During the transition we show a skeleton over the price row to indicate it’s recalculating the cart price and item prices.
4. The skeleton disappears before the cart is updated. This makes the UI less ideal.
Do you have any suggestions on how to tackle this without setting timeouts.
does this behavior persists using the
updateTag() and refresh() combo in next 16?Havent tried that. We are a large commerce platform so we will upgrade to 16 after the holiday period. Ill give it a look tho. Thanks