I'm debugging the Svelte app and wondering if it is possible to access svelte data in the store from the web console? Does somebody know if it is possible, if it yes, how pls :)
And by the way, we are still using svelte 1.
Following is a neat way to access store:
1.Define a property (ex: store) on window object and have its getter to log the store data.
Object.defineProperty(window, "store", {
get : _ => {
environmentV2.subscribe(e => console.log(e))
}
});
2.Type store in your console and press enter. You will see the store data as follows:

During initialization you can assign the store to the document object:
document.sveltestore = mystore;
this will work for svelte 1 & 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With