clever-components icon indicating copy to clipboard operation
clever-components copied to clipboard

RFC: About 2 way data binding and one direction data flow...

Open hsablonniere opened this issue 2 years ago • 0 comments

DRAFT (needs to be written in full details)

We do this in components that handle form controls/inputs

  • public prop foo
  • private prop _foo
  • update foo => _foo
  • input value=_foo
  • @input => _foo

This was inspired by 1 way data flow and "never update your own props".

  • It doesn't seem necessary (I need to check this with other people).
  • It's verbose and cumbersome to write.

Instead, we're considering doing simply this:

  • public prop foo
  • input value=foo
  • @input => foo

But it doesn't really work. We're still in a situation were reseting name from the parent wont work.

https://lit-and-friends.slack.com/archives/C03PF4L4L/p1658527483233609

playground example

hsablonniere avatar Jul 22 '22 22:07 hsablonniere