From 73b739e5941823cc00214ebda4882b73fbb1eb14 Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 24 Apr 2020 18:41:40 +0200 Subject: [PATCH] render output to document --- public/index.html | 4 +++- src/main/dda/masto_embed/app.cljs | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index b8f78af..3abd878 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,9 @@ masto-embed -
+
+ Here the timeline will appear. +
\ No newline at end of file diff --git a/src/main/dda/masto_embed/app.cljs b/src/main/dda/masto_embed/app.cljs index 1371185..1bdf1ab 100644 --- a/src/main/dda/masto_embed/app.cljs +++ b/src/main/dda/masto_embed/app.cljs @@ -49,5 +49,12 @@ (exit-with-error error) (callback response))))) +(defn render-to-document + [input] + (-> js/document + (.getElementById "mastodon-timeline") + (.-innerHTML) + (set! input))) + (defn init [] - (get-mastodon-timeline pprint)) \ No newline at end of file + (get-mastodon-timeline render-to-document)) \ No newline at end of file