♻️ Simplify audit events code

This commit is contained in:
Andrey Antukh 2024-03-14 12:53:26 +01:00
parent 91118bec70
commit 1a12e63027
15 changed files with 320 additions and 230 deletions

View file

@ -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]