mirror of
https://github.com/penpot/penpot.git
synced 2026-04-28 04:38:14 +00:00
🚧 Explicit state handling
This commit is contained in:
parent
1c209f49fc
commit
0281e0dba4
@ -421,12 +421,12 @@
|
||||
state (deref state*)
|
||||
|
||||
change-view (mf/use-fn
|
||||
(fn [type & [state']]
|
||||
(fn [type & {:keys [theme-path]}]
|
||||
(swap! state* (fn [current-state]
|
||||
(merge
|
||||
{:type type
|
||||
:prev-type (:type current-state)}
|
||||
state')))))
|
||||
(cond-> current-state
|
||||
:always (assoc :type type
|
||||
:prev-type (:type current-state))
|
||||
:theme-path (assoc :theme-path theme-path))))))
|
||||
|
||||
component (case (:type state)
|
||||
:empty-themes empty-themes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user