🎉 Enable conditional use of wasm module

This commit is contained in:
Belén Albeza 2024-09-12 09:32:46 +02:00
parent cd6a739abb
commit cc7ed497e8
9 changed files with 255 additions and 1 deletions

View file

@ -81,6 +81,7 @@
[app.util.router :as rt]
[app.util.storage :refer [storage]]
[app.util.timers :as tm]
[app.util.wasm :as wasm]
[app.util.webapi :as wapi]
[beicon.v2.core :as rx]
[cljs.spec.alpha :as s]
@ -349,6 +350,7 @@
(rx/merge
(rx/of (ntf/hide)
(features/initialize)
(when (contains? cf/flags :renderer-v2) (wasm/init))
(dcm/retrieve-comment-threads file-id)
(fetch-bundle project-id file-id))

View file

@ -0,0 +1,23 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns app.util.wasm
(:require
["./renderer/renderer" :as renderer]
["./renderer/renderer.js$default" :as renderer-init]
[beicon.v2.core :as rx]
[potok.v2.core :as ptk]))
(defn foo [] (renderer/print "Lorem ipsum"))
(defn init
[]
(ptk/reify ::init
ptk/WatchEvent
(watch [_ _ _] ;; TODO: mirar la docu de potok
(->> (rx/from (renderer-init))
(rx/tap foo)
(rx/ignore)))))