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

The trick to manage the DOM with vanilla HTML is to not use HTML! Then abstract code into functions. The advantage with modern JS frameworks is that they make it easier to handle state, and state handling is usually very hard. The trick to state handling in JavaScript is to make use of closures, to prevent the anti-pattern of global state where you don't know which functions change what state. The only function allowed to change the state should be function that created the element! This can be achieved with event listeners that listens for messages from the server.


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

Search: