8000 Allow `svelte/actions` to update passed variables · Issue #8959 · sveltejs/svelte · GitHub
[go: up one dir, main page]

Skip to content
Allow svelte/actions to update passed variables #8959
Closed as not planned
Closed as not planned
@szmarczak

Description

@szmarczak

Describe the problem

<script>
export let bar;

function foo(node, bar) {
	bar = 123;

	return {
		update(bar) {},
		destroy() {},
	};
}
</script>

<div use:foo={bar}>
	{bar}
</div>

Currently this prints undefined. This makes recreating bind:group much harder.

Describe the proposed solution

Allow svelte/actions to update passed variables.

Alternatives considered

The passed object could be a reference.

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0