Actually I've been wanting to write something like that for a long time but didn't get around to it. Nice to see someone else did exactly what I wanted...
Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
11–20 of 62 posts
Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#12That's the only javascript framework one needs. Actually I've been wanting to write something like that for a long time but didn't get around to it. Nice to see someone else did exactly what I wanted...
Im always under the assumption that the old "post data to server, save it there" model still works best. Am I missing something?
Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#13Looks very straight-forward. Good job! OT: After building a couple of large applications in Angular I've come to realize that I seldom need two-way bindings. The school example where you enter something in an input box and it shows up somewhere else in real-time is not really used in the real world. Or is it? Why do we need two-way data binding?
I rarely need _simultaneous_ two-way databinding. But I do sometimes need databinding from view to model (when I want users to enter data, and it just fills in my object), and I sometimes want databinding from model to view (where my data is nicely displayed). So rather than doing something fiddly and different for each way, it makes more sense to just have 2-way databinding in the first place. And that then makes it…
Wouldn't it be enough to add a keydown event to the field?
Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#14Looks very straight-forward. Good job! OT: After building a couple of large applications in Angular I've come to realize that I seldom need two-way bindings. The school example where you enter something in an input box and it shows up somewhere else in real-time is not really used in the real world. Or is it? Why do we need two-way data binding?
How about: Enter an amount in an input box and see a sub-total in real-time, or alert when constraints are violated? Possibilities are endless and you're more likely to implement them when it is so painless.
Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#15Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#16Earlier quoted context omitted.
How about: Enter an amount in an input box and see a sub-total in real-time, or alert when constraints are violated? Possibilities are endless and you're more likely to implement them when it is so painless.
Is it really more painless to add way.js and its dependencies (jquery.js, underscore.js, underscore.json.js, form2js.js and js2form.js) to your page then to simply add a plain javascript eventhandler to the field you want to validate?
That being said, could an implementation be done without jQuery? Probably. I'm sure the author is open to pull requests if you want to give it a go.
Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#17Great job, i just wish it was at least no dependent on several other libraries including jQuery.
Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#18That's the only javascript framework one needs. Actually I've been wanting to write something like that for a long time but didn't get around to it. Nice to see someone else did exactly what I wanted...
Does anybody have real world examples of websites that use this kind of thing? Im always under the assumption that the old "post data to server, save it there" model still works best. Am I missing something?
Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#19That's the only javascript framework one needs. Actually I've been wanting to write something like that for a long time but didn't get around to it. Nice to see someone else did exactly what I wanted...
Re: Show HN: Way.js – Simple, persistent, framework-agnostic two-way databinding
#20That's the only javascript framework one needs. Actually I've been wanting to write something like that for a long time but didn't get around to it. Nice to see someone else did exactly what I wanted...
Does anybody have real world examples of websites that use this kind of thing? Im always under the assumption that the old "post data to server, save it there" model still works best. Am I missing something?
Using way.js the button can be updated immediately whenever you change one of its properties, without waiting for a server response.
And saving the data to localstorage is very useful when the user is spending a long time filling the form and then accidentally closes the browser / clicks BACK / etc. It's a bit like autosaving a draft version of the form.