Skip to content

Commit 239fe1a

Browse files
committed
remove unneeded clj->js
1 parent 81812d8 commit 239fe1a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/electron/preload.cljs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
["electron" :refer [contextBridge ipcRenderer]]))
55

66
(defonce api
7-
{;; Strip event as it includes `sender`.
8-
;; https://www.electronjs.org/docs/latest/api/ipc-renderer#ipcrendereronchannel-listener
9-
:on (fn [channel f] (.on ipcRenderer channel (fn [_event args] (f args))))
10-
:send (fn [channel args] (.send ipcRenderer channel args))
11-
:invoke (fn [channel args] (.invoke ipcRenderer channel args))
12-
:platform (.-platform js/process)
13-
:versions (.-versions js/process)
14-
:env (.-env js/process)})
7+
#js {;; Strip event as it includes `sender`.
8+
;; https://www.electronjs.org/docs/latest/api/ipc-renderer#ipcrendereronchannel-listener
9+
:on (fn [channel f] (.on ipcRenderer channel (fn [_event args] (f args))))
10+
:send (fn [channel args] (.send ipcRenderer channel args))
11+
:invoke (fn [channel args] (.invoke ipcRenderer channel args))
12+
:platform (.-platform js/process)
13+
:versions (.-versions js/process)
14+
:env (.-env js/process)})
1515

1616
(defn ^:export init!
1717
"Expose protected methods that allow the renderer process to use the ipcRenderer.
1818
https://www.electronjs.org/docs/api/context-bridge"
1919
[]
20-
(.exposeInMainWorld contextBridge "api" (clj->js api)))
20+
(.exposeInMainWorld contextBridge "api" api))

0 commit comments

Comments
 (0)