mirror of
https://github.com/penpot/penpot.git
synced 2025-07-22 16:27:14 +02:00
♻️ Simplify audit events code
This commit is contained in:
parent
91118bec70
commit
1a12e63027
15 changed files with 320 additions and 230 deletions
|
@ -7,8 +7,10 @@
|
|||
(ns app.util.router
|
||||
(:refer-clojure :exclude [resolve])
|
||||
(:require
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.uri :as u]
|
||||
[app.config :as cf]
|
||||
[app.main.data.events :as ev]
|
||||
[app.util.browser-history :as bhistory]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.timers :as ts]
|
||||
|
@ -59,8 +61,13 @@
|
|||
(defn navigated
|
||||
[match]
|
||||
(ptk/reify ::navigated
|
||||
IDeref
|
||||
(-deref [_] match)
|
||||
ev/Event
|
||||
(-data [_]
|
||||
(let [route (dm/get-in match [:data :name])
|
||||
params (get match :path-params)]
|
||||
(assoc params
|
||||
::ev/name "navigate"
|
||||
:route (name route))))
|
||||
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue