Repository navigation
Support latest Nuxt in SSR utils - #34
kpdemetriou wants to merge 2 commits into
Conversation
|
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
| return getNuxtData().vueConcurrency[key].value; | ||
| } | ||
| if (process.client) { | ||
| onBeforeMount(async () => !task._instances.length && task.perform()); |
There was a problem hiding this comment.
why is onBeforeMount needed here? shouldn't if (process.client) be enough?
There was a problem hiding this comment.
This is personal preference and is analogous to how @nuxtjs/composition-api handles these sorts of cases internally. The alternative you propose should work, I imagine (but this hasn't been battle-tested like my implementation).
| } | ||
| if (process.client) { | ||
| onBeforeMount(async () => !task._instances.length && task.perform()); | ||
| reviveTaskInstances(key, task); |
There was a problem hiding this comment.
the revive happens after task.perform() ? shouldn't it be the other way around?
There was a problem hiding this comment.
In this case it's irrelevant because of onBeforeMount. In the alternative you proposed, you would need to revive the task instances prior to (conditionally) running task.perform().
|
It seems like your Prettier has quite a different style. Lack of |
|
This uses something other than Prettier, so some formatting is in order anyway; but good idea nonetheless. |
In continuation of #10, this version of
ssr-utils.jsshould work with all future^2versions of Nuxt.