mirror of
https://github.com/penpot/penpot.git
synced 2025-02-14 19:19:09 -05:00
Minor cosmetic changes on pages data events.
This commit is contained in:
parent
e97b4b8374
commit
922a2494ed
1 changed files with 12 additions and 5 deletions
|
@ -134,21 +134,28 @@
|
||||||
(reduce assoc-page $ pages)
|
(reduce assoc-page $ pages)
|
||||||
(reduce assoc-packed-page $ pages))))
|
(reduce assoc-packed-page $ pages))))
|
||||||
|
|
||||||
|
(defn pages-fetched
|
||||||
|
[pages]
|
||||||
|
{:pre [(coll? pages)]}
|
||||||
|
(PagesFetched. pages))
|
||||||
|
|
||||||
(defn pages-fetched?
|
(defn pages-fetched?
|
||||||
[v]
|
[v]
|
||||||
(instance? PagesFetched v))
|
(instance? PagesFetched v))
|
||||||
|
|
||||||
;; --- Fetch Pages (by project id)
|
;; --- Fetch Pages (by project id)
|
||||||
|
|
||||||
(deftype FetchPages [projectid]
|
(deftype FetchPages [id]
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state s]
|
(watch [_ state s]
|
||||||
(->> (rp/req :fetch/pages-by-project {:project projectid})
|
(->> (rp/req :fetch/pages-by-project {:project id})
|
||||||
(rx/map (comp ->PagesFetched :payload)))))
|
(rx/map :payload)
|
||||||
|
(rx/map pages-fetched))))
|
||||||
|
|
||||||
(defn fetch-pages
|
(defn fetch-pages
|
||||||
[projectid]
|
[id]
|
||||||
(FetchPages. projectid))
|
{:pre [(uuid? id)]}
|
||||||
|
(FetchPages. id))
|
||||||
|
|
||||||
;; --- Page Created
|
;; --- Page Created
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue