Go to file
Bjorn 16edbf9fee
Merge pull request #51 from bonzini/master
flatten: avoid early completion
2020-01-15 10:43:54 -08:00
doc Add an assertion like 'expect(observable).to.produce.error()' to test 'onError'. 2019-03-28 03:04:58 +09:00
examples Rename fromValue to of; 2016-10-15 10:31:23 -07:00
rockspec Add 0.0.3 rockspec; 2017-06-24 13:15:08 -07:00
src flatten: avoid early completion 2020-01-14 17:24:33 +01:00
tests flatten: avoid early completion 2020-01-14 17:24:33 +01:00
tools Update tools build version; 2018-09-12 11:22:58 -07:00
.editorconfig Add editorconfig 2019-10-09 10:30:11 +02:00
.luacov Test for 5.3 and luajit 2.1. 2017-05-27 13:30:10 -07:00
.travis.yml Test for 5.3 and luajit 2.1. 2017-05-27 13:30:10 -07:00
LICENSE Initial commit; 2015-07-15 00:47:23 -07:00
README.md Update README; 2018-09-12 11:36:04 -07:00
rx.lua flatten: avoid early completion 2020-01-14 17:24:33 +01:00

README.md

RxLua Build Status Coverage Status

Reactive Extensions for Lua.

RxLua gives Lua the power of Observables, which are data structures that represent a stream of values that arrive over time. They're very handy when dealing with events, streams of data, asynchronous requests, and concurrency.

Getting Started

Lua

Copy the rx.lua file into your project and require it:

local rx = require 'rx'

You can also install RxLua using luarocks:

luarocks install bjornbytes/rxlua

Luvit

Install using lit:

lit install bjornbytes/rx

Then require it:

local rx = require 'rx'

Love2D

See RxLove.

Example Usage

Use RxLua to construct a simple cheer:

local Rx = require 'rx'

Rx.Observable.fromRange(1, 8)
  :filter(function(x) return x % 2 == 0 end)
  :concat(Rx.Observable.of('who do we appreciate'))
  :map(function(value) return value .. '!' end)
  :subscribe(print)

-- => 2! 4! 6! 8! who do we appreciate!

See examples for more.

Resources

Tests

Uses lust. Run with:

lua tests/runner.lua

or, to run a specific test:

lua tests/runner.lua skipUntil

License

MIT, see LICENSE for details.