Reactive Extensions for Lua

bjorn 20a3c205be Add Observable:distinct; 10 年之前
doc bc5ab99d3c Update documentation; 10 年之前
examples 4175fde3a7 Add intro line to README; Update coroutine example; 10 年之前
tools bc5ab99d3c Update documentation; 10 年之前
LICENSE d64834faa6 Initial commit; 10 年之前
README.md bc5ab99d3c Update documentation; 10 年之前
rx.lua 20a3c205be Add Observable:distinct; 10 年之前

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.