Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize component references deeply nested inside an object provided as function argument #2

Open
vatro opened this issue Feb 23, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vatro
Copy link
Owner

vatro commented Feb 23, 2022

Given:

<!-- comp.svelte -->
<script>
export let props_obj = { foo: 1 }
$: if (props_obj) console.log("reactive on 'foo' change!")
</script>
// App.svelte

function do_something( obj ) {
 // component reference deeply nested inside an object provided as function argument
 // props_obj not reactive
  obj.data.comp_ref.props_obj.foo = 2
}

props_obj is not reactive. -> we would like it be reactive, like e.g.:

Given:

// App.svelte

let comp_ref // top-level declared component reference

function do_something() {
  // props_obj reactive
  comp_ref.props_obj.foo = 2
}

props_obj is reactive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant