logoalt Hacker News

dasherswyesterday at 10:18 AM1 replyview on HN

Hi, the author of Gea here. I have a long history of thinking about one- and two-way bindings, and I believe JavaScript as the language has a great solution to this. If you pass an object to a function, it's two-way bound, and if you pass a primitive, it's one-way bound. So I built Gea to replicate this. If users choose to pass an object in a one-way bound scenario, they could create a new object and pass that in, and it would work.

By the way, just as a syntactic sugar, Gea supports function components, too.


Replies

nine_kyesterday at 6:12 PM

Thank you for your project, it's elegant! It's pretty obvious that one-way binding is a two-way binding with one of the roads not taken. I see that e.g. a careful naming scheme could make it obvious what is reactive, and what is not.

OTOH React arrived where it's now not by allowing a particular approach, but by enforcing it.