Skip to content

How to prevent page reload from action? #391

Answered by caseybaggz
caseybaggz asked this question in Q&A
Discussion options

You must be logged in to vote

@ryansolid ok, I figured it out. It was 200% my fault and I'm so so sorry for wasting your time. But, I think this is a great lesson for people who might find this thread.

TL;DR - I had createAsync/cache vomit 🤮

Basically, I was thinking (due to the naming convention) that if the cache functions ran once within 5m or so, it would just return the data and not make server calls. However, I noticed this was incorrect watching my network tab.

To your point - action triggers cache which by nature triggers the createAsync.

Answer

After analyzing my codebase, I updated my "root context" to hold a few more values that I now know I need in a lot of diff routes. Thus, I was able to eliminate a ton of

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@ryansolid
Comment options

@caseybaggz
Comment options

@caseybaggz
Comment options

@caseybaggz
Comment options

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