Browse Source

feature: upgrade reddit app to use a virtual dom

002/portal
Tyler Childs 2 months ago
parent
commit
ab5c5261b7
  1. 6
      home/root/views/reddit-render.js

6
home/root/views/reddit-render.js

@ -3,6 +3,8 @@
License: Public Domain
Date: 2021-25-03
*/
import { innerHTML } from 'https://unpkg.com/diffhtml?module';
import {
RESOURCE_REDDIT
} from '../../../resources.js';
@ -36,14 +38,14 @@ function render(event) {
`)
.join("");
event.target.innerHTML = `
innerHTML(event.target, `
<ol>
${list}
</ol>
<button class="moar-posts" data-id="${id}" data-after="${after}">
Load More
</button>
`;
`);
}
function renderPost(data) {

Loading…
Cancel
Save