getValdresContext
Signature
getValdresContext(): Storevaldres-svelte Access the current store instance
Retrieves the valdres store from the nearest setValdresContext in the component tree. Use this when you need direct store access.
Usage
<script>
import { getValdresContext } from "valdres-svelte"
const store = getValdresContext()
function logValue() {
console.log("Current:", store.get(myAtom))
}
</script>
<button onclick={logValue}>Log value</button>
See also
- setValdresContext — provide a store to the component tree
- store — create a store instance