mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 12:59:12 -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]
|
[projects]
|
||||||
(ProjectsFetched. projects))
|
(ProjectsFetched. projects))
|
||||||
|
|
||||||
|
(defn projects-fetched?
|
||||||
|
[v]
|
||||||
|
(instance? ProjectsFetched v))
|
||||||
|
|
||||||
;; --- Fetch Projects
|
;; --- Fetch Projects
|
||||||
|
|
||||||
(defrecord FetchProjects []
|
(defrecord FetchProjects []
|
||||||
rs/WatchEvent
|
rs/WatchEvent
|
||||||
(-apply-watch [_ state s]
|
(-apply-watch [_ state s]
|
||||||
(letfn [(on-loaded [{projects :payload}]
|
(->> (rp/req :fetch/projects)
|
||||||
#(reduce stpr/assoc-project % projects))]
|
(rx/map :payload)
|
||||||
(->> (rp/req :fetch/projects)
|
(rx/map projects-fetched))))
|
||||||
(rx/map on-loaded)))))
|
|
||||||
|
|
||||||
(defn fetch-projects
|
(defn fetch-projects
|
||||||
[]
|
[]
|
||||||
|
|
Loading…
Add table
Reference in a new issue