mirror of
https://github.com/penpot/penpot.git
synced 2025-02-12 18:18:24 -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-packed-page $ pages))))
|
||||
|
||||
(defn pages-fetched
|
||||
[pages]
|
||||
{:pre [(coll? pages)]}
|
||||
(PagesFetched. pages))
|
||||
|
||||
(defn pages-fetched?
|
||||
[v]
|
||||
(instance? PagesFetched v))
|
||||
|
||||
;; --- Fetch Pages (by project id)
|
||||
|
||||
(deftype FetchPages [projectid]
|
||||
(deftype FetchPages [id]
|
||||
ptk/WatchEvent
|
||||
(watch [_ state s]
|
||||
(->> (rp/req :fetch/pages-by-project {:project projectid})
|
||||
(rx/map (comp ->PagesFetched :payload)))))
|
||||
(->> (rp/req :fetch/pages-by-project {:project id})
|
||||
(rx/map :payload)
|
||||
(rx/map pages-fetched))))
|
||||
|
||||
(defn fetch-pages
|
||||
[projectid]
|
||||
(FetchPages. projectid))
|
||||
[id]
|
||||
{:pre [(uuid? id)]}
|
||||
(FetchPages. id))
|
||||
|
||||
;; --- Page Created
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue