Skip to content

Instantly share code, notes, and snippets.

@nedzadarek
Created May 16, 2018 14:59
Show Gist options
  • Save nedzadarek/1032c715eedea2f9224b092cd2dea094 to your computer and use it in GitHub Desktop.
Save nedzadarek/1032c715eedea2f9224b092cd2dea094 to your computer and use it in GitHub Desktop.
; rea: make deep-reactor! [
rea: object [
a: [1 2 3 4 5]
s: "abbccbba"
on-deep-change*: func [
owner
word
target
action
new
index
part
][
print "################"
print "on-deep-change*"
print ["owner: " mold owner]
print ["word: " word]
print ["target: " mold target]
print ["action: " action]
print ["new: " mold new]
print ["index: " index]
print ["part: " part]
]
on-change*: func [
word
old
nnew
][
print "################"
print "on-change*"
print ["word: " word]
print ["old: " mold :old]
print ["new: " mold :nnew]
]
]
rea/a
rea/a/1: 11
rea/s/2: #"z"
? rea
trim/with/all rea/s #"a"
; rea/a: [1]
; rea/a/1: 0 ; won't trigger on-deep-change in the old console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment