remove duplicate code

phoen
Daniel Barlow 2022-02-20 12:21:39 +00:00
parent b92785f495
commit 117cb8be47
1 changed files with 4 additions and 8 deletions

View File

@ -6,14 +6,10 @@
(fn update [data self path value]
(let [[first & rest] path]
(if (next rest)
(do
(update (. data first) self rest value)
(if data._subscribers
(each [_ f (pairs data._subscribers)] (f))))
(do
(if data._subscribers
(each [_ f (pairs data._subscribers)] (f)))
(tset data first value)))))
(update (. data first) self rest value)
(tset data first value))
(if data._subscribers
(each [_ f (pairs data._subscribers)] (f)))))
(fn get [data self path]
(let [[first & rest] path]