File tree 3 files changed +16
-10
lines changed
3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 156
156
[:<>
157
157
[:h3.font-bold (if (= k :appliesto )
158
158
" Applies to"
159
- (-> k csk/->kebab-case-string (str/replace " -" " " ) str/capitalize))]
159
+ (-> (csk/->kebab-case-string k)
160
+ (str/replace " -" " " )
161
+ (str/capitalize )))]
160
162
[:p (cond->> v (vector? v) (str/join " | " ))]]))
161
163
162
164
(defn property-list
Original file line number Diff line number Diff line change 5
5
6
6
(rf/reg-fx
7
7
::post
8
- (fn [{:keys [data on-success]}]
9
- (let [worker (js/Worker. " js/worker.js" )]
8
+ (fn [{:keys [data on-success on-error]}]
9
+ (let [worker (js/Worker. " js/worker.js" )
10
+ id (uuid (:id data))]
10
11
(.addEventListener
11
12
worker
12
13
" message"
13
- #(let [response-data (js->clj (.. % -data) :keywordize-keys true )
14
- id (uuid (:id response-data))]
15
- (rf/dispatch [::worker.e/completed id on-success response-data])))
14
+ #(let [response-data (js->clj (.. % -data) :keywordize-keys true )]
15
+ (rf/dispatch [::worker.e/message id on-success response-data])))
16
+
17
+ (.addEventListener worker " error" #(rf/dispatch [::worker.e/message id on-error %]))
18
+
16
19
(.postMessage worker (clj->js data)))))
Original file line number Diff line number Diff line change 14
14
(assoc-in [:data :action ] (:action options)))}))
15
15
16
16
(rf/reg-event-fx
17
- ::completed
18
- (fn [{:keys [db]} [_ id on-success response-data]]
19
- {:db (update-in db [:worker :tasks ] dissoc id)
20
- :dispatch (conj on-success response-data)}))
17
+ ::message
18
+ (fn [{:keys [db]} [_ id event response-data]]
19
+ (cond-> {:db (update-in db [:worker :tasks ] dissoc id)}
20
+ event
21
+ (assoc :dispatch (conj event response-data)))))
You can’t perform that action at this time.
0 commit comments