Reputation: 743
I have an object with a Writable
property. Is there a way to use the $store
syntax directly with object.property
, or am I going to have to give the store its own name?
<script lang="ts">
export let motor: Motor;
// {
// profile: Writable<string>
// }
console.log($motor.profile) // nope
console.log(motor.$profile) // nope
console.log($(motor.profile)) // nope
let { profile } = motor;
console.log($profile); // sure
</script>
Upvotes: 0
Views: 60
Reputation: 794
There is no way to use the $store syntax directly with object.property. You will have to give the store its own name.
Upvotes: 2