MCPcopy Index your code
hub / github.com/koajs/examples / render

Method render

stream-view/view.js:17–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 _read() {}
16
17 *render() {
18 // push the <head> immediately
19 this.push('<!DOCTYPE html><html><head><title>Hello World</title></head>');
20
21 // render the <body> on the next tick
22 const body = yield done => {
23 setImmediate(() => done(null, '<p>Hello World</p>'));
24 };
25
26 this.push('<body>' + body + '</body>');
27
28 // close the document
29 this.push('</html>');
30
31 // end the stream
32 this.push(null);
33 };
34};

Callers 4

listFunction · 0.80
addFunction · 0.80
showFunction · 0.80
app.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected