File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 535
535
(:nextjournal/render-opts x)
536
536
{:viewer viewer :path path})]))))
537
537
538
+
539
+ ; ; TODO: figure out if we can make `inspect` work synchronously by
540
+ ; ; evaluating the `:render-fn`s on init to fix the flicker
541
+ (declare await-render-fns )
542
+ (defn await+inspect-presented [x]
543
+ (when-let [desc (hooks/use-promise (await-render-fns x))]
544
+ [inspect-presented desc]))
545
+
538
546
(defn inspect [value]
539
547
(r/with-let [!state (r/atom nil )]
540
548
(when (not= (:value @!state ::not-found ) value)
546
554
(.resolve js/Promise (present-elision-fn fetch-opts)))
547
555
(fn [more]
548
556
(swap! !state update :desc viewer/merge-presentations more fetch-opts))))}
549
- [inspect-presented (:desc @!state)]]))
557
+ [await+ inspect-presented (:desc @!state)]]))
550
558
551
559
(defn show-panel [panel-id panel]
552
560
(swap! !panels assoc panel-id panel))
You can’t perform that action at this time.
0 commit comments