💄 Change some code styles

This commit is contained in:
Andrés Moya 2022-03-10 15:21:14 +01:00
parent e609670a41
commit 7b81bb3fc2
5 changed files with 57 additions and 47 deletions

View file

@ -29,8 +29,8 @@
ptk/WatchEvent
(watch [it state _]
(let [page (wsh/lookup-page state)
flows (get-in page [:options :flows] [])
flows (get-in page [:options :flows] [])
unames (into #{} (map :name flows))
name (dwc/generate-unique-name unames "Flow-1")
@ -41,8 +41,7 @@
(rx/of (dch/commit-changes
(-> (pcb/empty-changes it)
(pcb/with-page page)
(pcb/set-page-option :flows
(csp/add-flow flows new-flow)))))))))
(pcb/update-page-option :flows csp/add-flow new-flow))))))))
(defn add-flow-selected-frame
[]
@ -58,13 +57,11 @@
(ptk/reify ::remove-flow
ptk/WatchEvent
(watch [it state _]
(let [page (wsh/lookup-page state)
flows (get-in page [:options :flows] [])]
(let [page (wsh/lookup-page state)]
(rx/of (dch/commit-changes
(-> (pcb/empty-changes it)
(pcb/with-page page)
(pcb/set-page-option :flows
(csp/remove-flow flows flow-id)))))))))
(pcb/update-page-option :flows csp/remove-flow flow-id))))))))
(defn rename-flow
[flow-id name]
@ -73,14 +70,12 @@
(ptk/reify ::rename-flow
ptk/WatchEvent
(watch [it state _]
(let [page (wsh/lookup-page state)
flows (get-in page [:options :flows] [])]
(let [page (wsh/lookup-page state) ]
(rx/of (dch/commit-changes
(-> (pcb/empty-changes it)
(pcb/with-page page)
(pcb/set-page-option :flows
(csp/update-flow flows flow-id
#(csp/rename-flow % name))))))))))
(pcb/update-page-option :flows csp/update-flow flow-id
#(csp/rename-flow % name)))))))))
(defn start-rename-flow
[id]