remove duplicate code
This commit is contained in:
parent
b92785f495
commit
117cb8be47
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user