1 year ago

When to use nuxtserverinit

Posted 1 year ago by SkyCoder

I have schools page where I have 1500 schools that probably never change.

I want to on each school pages open, make request to api to check is school table updated. If it is I would change data within store and local storage and cookies.

I tried using asyncData() {} that needs to have return, but I am not returning any data but updating state if versions are not the same.

I looked up for nuxtserverinit but I am not sure how it works and when to use it?

Is there a better solution for this?

Please sign in or create an account to participate in this conversation.