mirror of https://github.com/sveltejs/svelte
no warning on contextual-store if declaring it as a parameter / variable (#6008)
parent
8ea4fb1106
commit
b764374b62
@ -0,0 +1 @@
|
|||||||
|
export default {};
|
@ -0,0 +1,25 @@
|
|||||||
|
<script>
|
||||||
|
function test(store) {
|
||||||
|
// allow declaring $store as parameter
|
||||||
|
// it's not referring to the store value of the
|
||||||
|
// `store` variable in the upper scope
|
||||||
|
return derived(store, $store => {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function test2(store) {
|
||||||
|
// allow declaring the `$store` variable
|
||||||
|
// it is not referring to the store value of the `store` variable
|
||||||
|
let $store;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div
|
||||||
|
on:test={(store) => {
|
||||||
|
derived(store, $store => {});
|
||||||
|
}}
|
||||||
|
on:test2={(store) => {
|
||||||
|
let $store;
|
||||||
|
}}
|
||||||
|
/>
|
Loading…
Reference in new issue