render output to document

This commit is contained in:
jem 2020-04-24 18:41:40 +02:00
parent f3c9b3bd99
commit 73b739e594
2 changed files with 11 additions and 2 deletions

View file

@ -5,7 +5,9 @@
<title>masto-embed</title> <title>masto-embed</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="mastodon-timeline">
Here the timeline will appear.
</div>
<script src="js/main.js"></script> <script src="js/main.js"></script>
</body> </body>
</html> </html>

View file

@ -49,5 +49,12 @@
(exit-with-error error) (exit-with-error error)
(callback response))))) (callback response)))))
(defn render-to-document
[input]
(-> js/document
(.getElementById "mastodon-timeline")
(.-innerHTML)
(set! input)))
(defn init [] (defn init []
(get-mastodon-timeline pprint)) (get-mastodon-timeline render-to-document))