Guest User

Untitled

a guest
Feb 25th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. var html = require('./index')
  2.  
  3. var world = 'xyz'
  4. var planet = [
  5. document.createElement('strong')
  6. ]
  7. planet[0].textContent = 'planet'
  8.  
  9. var res = html.render(Main(world, planet))
  10. function Main (world, who) {
  11. return html`
  12. <div id="hello" class='def ${world}'>
  13. hello
  14. ${who}
  15. </div>
  16. `
  17. }
  18.  
  19. setTimeout(function () {
  20. res.update(Main(
  21. "abc",
  22. document.createTextNode('planet')
  23. ))
  24. }, 3000)
  25.  
  26. console.log(res)
  27. document.body.appendChild(res.element)
Add Comment
Please, Sign In to add comment