4 ms·
It doesn't replace running all code on both client and server, but for certain use cases it does. For example, you have a blog post with comments and a form th
by jonnytran 18y ago
It doesn't replace running all code on both client and server, but for certain use cases it does.
For example, you have a blog post with comments and a form that allows you to post new comments. When a person visits the page, the HTML of all current comments is loaded. The code to generate that HTML is on the server. But say that you want the interface to be very responsive, and when someone posts a new comment, you want to be able to display that comment in the list with others w/o waiting for the response from the server. Ideally the same code that generated the HTML for the original list can be used to generate the HTML for this new comment -- but on the client.
(Of course, to actually store the new comment, you need server side code, which I'm not saying it will eliminate at all.)