Currently, Nuxt.js does not have a way to create actions to be done only on the client.
It is possible to implement it using plugins and middleware, but it will be implemented with a different interface from nuxtServerInit.
Also, in SPA mode there is no equivalent of nuxtServerInit.
In order to solve this problem, I would like to add nuxtServerInit for clients.
I implemented it as a module of Nuxt.js. However, I want Nuxt.js core to have nuxtClientInit.
https://github.com/potato4d/nuxt-client-init-module
Although it was written that it is advancing the implementation before, is there any plan to implement it?
If possible, I would like to collaborate on implementation.
https://github.com/nuxt/nuxt.js/issues/1857#issuecomment-336874401
Hey @potato4d!
Sure, fire up a PR for it and we'll look into it 鈽猴笍
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Doing it now!
@potato4d Any update? 鈽猴笍
@manniL
I am trying hard but I am a bit struggling.
The goal is to submit a pull request next week!
@potato4d Take your time and don't hesitate to ask for help if you get stuck 鈽猴笍
Closing this in favor of the linked PR, (possibly) upcoming RFC and further updates.
So what is the solution now?
@johanvanwambeke feel free to use https://github.com/potato4d/nuxt-client-init-module
I really would like to see this as a core functionality of Nuxt.
Imo the most elegant solution would be something like nuxtInit (or storeInit or something) that is run on either client or server depending on universal/spa mode. (but it would not run twice).
Most helpful comment
I really would like to see this as a core functionality of Nuxt.
Imo the most elegant solution would be something like nuxtInit (or storeInit or something) that is run on either client or server depending on universal/spa mode. (but it would not run twice).