I am using Svelte to develop my project.
I used the Svelte store to save the user details.
In store.js define userDetails variable.
export let userDetails = writable({})
After login stored userDetails in /login/index.js
userDetails.set(user)
Now trying to access this set user details in __layout.svelte
import { userDetails } from '$lib/stores/store'
When I'm trying to get value from the store it shows the value for a few seconds and after that, it displayed 'undefined'
In the terminal, userDetails are get displayed properly, but while trying to get details on the browser it shows an undefined and an empty array.