Skip to content

how can I send getter setter to bind from a variable? #14617

@sukeshpabolu

Description

@sukeshpabolu

Describe the bug

This is allowed and good: https://svelte.dev/blog/advent-of-svelte#Day-8:-functional-bindings

need a way to use the similar thing to the following variable on bind:

const checked = {
		get: () => {
			return flag == 'YES';
		},
		  set: (isChecked) => {
			flag = isChecked ? 'YES' : 'NO'
		}
	};

Reproduction

svelte playground

Logs

No response

System Info

svelte dev tutorial

Severity

annoyance

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