-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datalog-console): respond to datalog-console messages (#91)
Co-authored-by: Chris Smothers <[email protected]>
- Loading branch information
1 parent
c17ec93
commit e5584da
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(ns homebase.datalog-console | ||
(:require [goog.object :as gobj] | ||
[cljs.reader])) | ||
|
||
(js/document.documentElement.setAttribute "__datalog-console-remote-installed__" true) | ||
|
||
(defn init! | ||
[{:keys [conn]}] | ||
(.addEventListener js/window "message" | ||
(fn [event] | ||
(when-let [devtool-message (gobj/getValueByKeys event "data" ":datalog-console.client/devtool-message")] | ||
(let [msg-type (:type (cljs.reader/read-string devtool-message))] | ||
(case msg-type | ||
|
||
:datalog-console.client/request-whole-database-as-string | ||
(.postMessage js/window #js {":datalog-console.remote/remote-message" (pr-str @conn)} "*") | ||
|
||
nil)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e5584da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
homebase-example-todo – ./examples/todo
homebase-example-todo.vercel.app
homebase-example-todo-homebaseio.vercel.app
homebase-example-todo-git-master-homebaseio.vercel.app
e5584da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
homebase-example-counter – ./examples/counter
homebase-example-counter.vercel.app
hbre-counter.vercel.app
homebase-example-counter-homebaseio.vercel.app
homebase-example-counter-git-master-homebaseio.vercel.app
e5584da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
homebase-example-roam – ./examples/roam
homebase-example-roam.vercel.app
roamdemo.homebase.io
homebase-example-roam-homebaseio.vercel.app
homebase-example-roam-git-master-homebaseio.vercel.app
e5584da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
homebase-example-ts-firebase-todo – ./examples/typescript-firebase-todo
homebase-react-examples-typescript-firebase-todo.vercel.app
homebase-example-ts-firebase-todo.vercel.app
homebase-example-ts-firebase-todo-homebaseio.vercel.app
homebase-example-ts-firebase-todo-git-master-homebaseio.vercel.app