mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 04:49:03 -05:00
Properly use projects fetched event after fetch projects event.
This commit is contained in:
parent
034c26fed4
commit
b148de7fc0
1 changed files with 7 additions and 4 deletions
|
@ -27,15 +27,18 @@
|
|||
[projects]
|
||||
(ProjectsFetched. projects))
|
||||
|
||||
(defn projects-fetched?
|
||||
[v]
|
||||
(instance? ProjectsFetched v))
|
||||
|
||||
;; --- Fetch Projects
|
||||
|
||||
(defrecord FetchProjects []
|
||||
rs/WatchEvent
|
||||
(-apply-watch [_ state s]
|
||||
(letfn [(on-loaded [{projects :payload}]
|
||||
#(reduce stpr/assoc-project % projects))]
|
||||
(->> (rp/req :fetch/projects)
|
||||
(rx/map on-loaded)))))
|
||||
(->> (rp/req :fetch/projects)
|
||||
(rx/map :payload)
|
||||
(rx/map projects-fetched))))
|
||||
|
||||
(defn fetch-projects
|
||||
[]
|
||||
|
|
Loading…
Add table
Reference in a new issue