Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 495 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 495 Bytes

Usage

require "reactivity"

Create a new reactive variable

initreactive("counter", 0, function(value)
    print("Counter changed to "..value)
end)

print(counter) --> 0
counter = counter + 1 --> Counter changed to 1

Make an existing variable reactive

counter = 0

makereactive("counter", function(value)
    print("Counter changed to "..value)
end)

print(counter) --> 0
counter = counter + 1 --> Counter changed to 1