({ title, description, url })
| 54 | function 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected