Skip to content

Commit

Permalink
v0.6.14: always relay firehose messages
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Oct 26, 2017
1 parent 7de2d18 commit 51acfa9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).


## [0.6.14] - 2017-10-26
### Changed
- always relay firehose messages

## [0.6.13] - 2017-10-13
### Changed
- window-id in sessionStorage
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject matthiasn/systems-toolbox-electron "0.6.13"
(defproject matthiasn/systems-toolbox-electron "0.6.14"
:description "Building blocks for ClojureScript systems on top of Electron"
:url "https://github.com/matthiasn/systems-toolbox-electron"
:license {:name "Eclipse Public License"
Expand Down
14 changes: 10 additions & 4 deletions src/matthiasn/systems_toolbox_electron/ipc_renderer.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns matthiasn.systems-toolbox-electron.ipc-renderer
(:require [electron :refer [ipcRenderer]]
[taoensso.timbre :as timbre :refer-macros [info debug error]]
[cljs.reader :refer [read-string]]))
[cljs.reader :refer [read-string]]
[clojure.set :as set]))

(defn state-fn [put-fn]
(let [state (atom {})
Expand Down Expand Up @@ -32,6 +33,11 @@
{})

(defn cmp-map [cmp-id relay-types]
{:cmp-id cmp-id
:state-fn state-fn
:handler-map (zipmap relay-types (repeat relay-msg))})
(let [relay-types (set/union (set relay-types)
#{:firehose/cmp-put
:firehose/cmp-recv
:firehose/cmp-publish-state
:firehose/cmp-recv-state})]
{:cmp-id cmp-id
:state-fn state-fn
:handler-map (zipmap relay-types (repeat relay-msg))}))
10 changes: 8 additions & 2 deletions src/matthiasn/systems_toolbox_electron/window_manager.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
(ns matthiasn.systems-toolbox-electron.window-manager
(:require [taoensso.timbre :as timbre :refer-macros [info debug warn]]
[electron :refer [BrowserWindow]]
[matthiasn.systems-toolbox.component :as stc]))
[matthiasn.systems-toolbox.component :as stc]
[clojure.set :as set]))

(defn serialize [msg-type msg-payload msg-meta]
(let [serializable [msg-type {:msg-payload msg-payload :msg-meta msg-meta}]]
Expand Down Expand Up @@ -161,7 +162,12 @@
{:send-to-self [:window/new {:url "view.html"}]}))

(defn cmp-map [cmp-id relay-types app-path]
(let [relay-map (zipmap relay-types (repeat relay-msg))]
(let [relay-types (set/union (set relay-types)
#{:firehose/cmp-put
:firehose/cmp-recv
:firehose/cmp-publish-state
:firehose/cmp-recv-state})
relay-map (zipmap relay-types (repeat relay-msg))]
{:cmp-id cmp-id
:state-fn (fn [put-fn] {:state (atom {:app-path app-path})})
:handler-map (merge relay-map
Expand Down

0 comments on commit 51acfa9

Please sign in to comment.