When is the plugin ready to be used?
See original GitHub issueLoading from localStorage
seems immediate when the application starts, but when writing to the vuex store persistence doesn’t seem to work until some time has passed.
If I do this in root component the state in localStorage
doesn’t change:
const root = new Vue({
el: '#app',
router,
store,
render: (h) => h(App),
mounted () {
store.commit('persistent/SET_TEST_VAR', true);
console.log(store.state.persistent.test_var);
}
});
If I do this instead it works fine:
setTimeout(() => {
store.commit('persistent/SET_TEST_VAR', true);
console.log(store.state.persistent.test_var);
}, 1000);
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Vue - mount vue when plugin is ready - Stack Overflow
My base question: is it possible to mount "vue" when plugin finish http request and data in plugin is ready? I could use...
Read more >Plugins - Fastify
A plugin can be a set of routes, a server decorator, or whatever. The API that you will need to use one or...
Read more >PHP 8.0x when will WordPress and plugins be ready to use it
My two Ubuntu WordPress servers keep upgrading PHP 7.4.x and 8.0.x. I am staying on 7.4.x for now. I was hoping WordPress would...
Read more >How and when to use WordPress Plugins. - Illustrate Digital
First off, go to the WordPress plugin page and click “Add New.” There, plugins will be split up into several categories including “popular...
Read more >BYFP 4: Building Your Plugin – Figma Help Center
By including this in our project, we can access ready to use elements without having to build them from scratch. To include the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I managed to find a workaround if you’re using VueRouter
Given you have the strict
RESTORE_MUTATION
setup;Take special note to using
store._vm
to receive the event from the bus.Thank you @PierBover. I managed to do this with localforage inspired by your plugin.
And then in any kind of component: