SvelteKit / Svelte : Not able to get or set (Read or Write) values from the "store" in the context module.
import {selectedStore} from "src/storelocation";
<script context="module">
  export const load = async ({params})=> {
    
     $selectedStore.value // throwing error
  }
                import {selectedStore} from "src/storelocation";
import { get } from 'svelte/store';
<script context="module">
export const load = async ({params})=> {
  // use this
 get(selectedStore).value;
}
                        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