You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The readme says "streaming friendly," but I can't seem to see how in the code that would be possible. I'm pretty new to node and js so I'm sure I could just be overlooking something...
The text was updated successfully, but these errors were encountered:
By streaming friendly I meant that you can write out partial results during template rendering.
Say you have to iterate over a big result set in your template and produce a list. With doT you can write out each list item (or a batch of several items) as you go (vs engines that do push/join for example).
To do it you would write the content of 'out' variable out, and reset 'out' variable to an empty string, like this (say you passed response object to the template function):
{{ your iterator here { }}
/* list item template here */
{{=item.name}}
/* flush out and reset */
{{ it.response.write(out); out=""; }}
{{ } }}
Laura
On 2012-02-20, at 1:35 PM, ConstableJoe wrote:
The readme says "streaming friendly," but I can't seem to see how in the code that would be possible. I'm pretty new to node and js so I'm sure I could just be overlooking something...
Reply to this email directly or view it on GitHub: #21
The readme says "streaming friendly," but I can't seem to see how in the code that would be possible. I'm pretty new to node and js so I'm sure I could just be overlooking something...
The text was updated successfully, but these errors were encountered: