Re:Imba – A new programming language for the web
by gosukiwi on Thursday August 20, 2015 @02:52PM
(#10093855)
How does it handle data binding?
[ Parent
| on HN ]
Re:Imba – A new programming language for the web
by creamyhorror on Thursday August 20, 2015 @03:03PM
(#10093924)
It 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.