Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Vue discourages 2-way binding between components and instead suggests binding data down to children and requiring children to emit events up to their parents to request shared state mutation [0]. I'm not sure how elegant it is, but it seems logical to delegate the responsibility of state management to the components that originally provide the data.

[0]: https://vuejs.org/v2/guide/components-custom-events.html#syn...



The data-down, events-up architecture is fairly popular not just with Vue but React, Ember and other frameworks as well. The main criticism of it (at least in React-land) was that you ended up with a lot of noise from having to pass unrelated things up and down from intermediate components. This is what React context and higher-order components were meant to address when they were conceived.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: