Reactive Extensions for Lua

bjorn 606b7c90c6 Add Observable.filter; 10 år sedan
doc b6e5811b3e Documentation for Observable:distinct; 10 år sedan
examples d8b72e85be Push values to subjects by calling them as functions; 10 år sedan
tools bc5ab99d3c Update documentation; 10 år sedan
LICENSE d64834faa6 Initial commit; 10 år sedan
README.md bc5ab99d3c Update documentation; 10 år sedan
rx.lua 606b7c90c6 Add Observable.filter; 10 år sedan

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.