const name = new State("Enter your name here...")
const input = document.createElement("input")
sync(input, "value", name)
What should happen when the user changes input.value
by typing into the input?
Currently it does nothing, which causes the input to get out of sync. But maybe it's too much to hijack it in the reverse.
What about introducing another function that syncs both ways?
const name = new State("Enter your name here...")
const input = document.createElement("input")
bind(input, "value", name)
Not sure it's a good idea to introduce another function.
If I do, the naming of sync
would need to change to better represent that it DOESN'T sync both ways I think.
enhancement question