4 ms·
How does it handle data binding?
by gosukiwi 11y ago
How does it handle data binding?
- creamyhorror 11y agoIt looks similar to React's one-way data flow - that render method produces the whole app view, and refers to all the necessary variables. When an event occurs [e.g. the user types text to add and hits enter]: - the appropriate method is called [e.g. add] - which mutates the state [e.g. TodoList.push(TodoItem.new(title.trim))] - and then render is called, which updates the view/DOM So in a sense it's not really data-binding, IMO - instead, the render method contains the entire view + view logic, and it gets called each time the state is changed.