Reactive Extensions for Lua

bjorn 84113efae1 Update documentation; 10 years ago
doc 84113efae1 Update documentation; 10 years ago
examples 4175fde3a7 Add intro line to README; Update coroutine example; 10 years ago
tools 84113efae1 Update documentation; 10 years ago
LICENSE d64834faa6 Initial commit; 10 years ago
README.md 4175fde3a7 Add intro line to README; Update coroutine example; 10 years ago
rx.lua 128f3f4ad0 Improve documentation; 10 years ago

README.md

RxLua

Reactive Extensions for Lua.

Examples

Cheer someone on using functional reactive programming:

local Rx = require 'rx'

local observable = Rx.Observable.fromCoroutine(function()
  for i = 2, 8, 2 do
    coroutine.yield(i)
  end

  return 'who do we appreciate'
end)

observable
  :map(function(value) return value .. '!' end)
  :subscribe(print)

repeat
  Rx.scheduler:update()
until Rx.scheduler:isEmpty()

See examples for more.

Documentation

See here.

License

MIT, see LICENSE for details.