0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-22 23:06:08 -05:00
penpot/frontend/src/uxbox/main/worker.cljs
2020-04-20 11:56:10 +02:00

27 lines
740 B
Clojure

;; 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/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2020 UXBOX Labs SL
(ns uxbox.main.worker
(:require
[cljs.spec.alpha :as s]
[uxbox.config :as cfg]
[uxbox.common.spec :as us]
[uxbox.util.worker :as uw]))
(defn on-error
[instance error]
(js/console.log "error on worker" error))
(defonce instance
(when (not= *target* "nodejs")
(uw/init "js/worker.js" on-error)))
(defn ask!
[message]
(uw/ask! instance message))