MCPcopy Index your code
hub / github.com/ErickWendel/processing-30GB-data-with-JavaScript-Streams / write

Function write

recorded/app/index.js:56–73  ·  view source on GitHub ↗
({ title, description, url })

Source from the content-addressed store, hash-verified

54function appendToHtml(element) {
55 return new WritableStream({
56 write({ title, description, url }) {
57 const card = `
58 <article>
59 <div class="text">
60 <h3>[${++counter}] ${title}</h3>
61 <p>${description.slice(0, 100)}</p>
62 <a href="${url}">Here's why</a>
63 </div>
64 </article>
65 `
66 if (++elementCounter > 20) {
67 element.innerHTML = card
68 elementCounter = 0
69 return
70 }
71
72 element.innerHTML += card
73 },
74 abort(reason) {
75 console.log('aborted*', reason)
76 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected