Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bjornbytes/RxLua
Reactive Extensions for Lua
https://github.com/bjornbytes/RxLua
Last synced: 4 months ago
JSON representation
Reactive Extensions for Lua
- Host: GitHub
- URL: https://github.com/bjornbytes/RxLua
- Owner: bjornbytes
- License: mit
- Created: 2015-07-15T07:40:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-21T03:32:15.000Z (over 4 years ago)
- Last Synced: 2024-06-21T02:01:11.214Z (8 months ago)
- Language: Lua
- Homepage:
- Size: 312 KB
- Stars: 511
- Watchers: 31
- Forks: 78
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-defold - RxLua
README
RxLua [![Build Status](https://travis-ci.org/bjornbytes/RxLua.svg)](https://travis-ci.org/bjornbytes/RxLua) [![Coverage Status](https://coveralls.io/repos/github/bjornbytes/RxLua/badge.svg?branch=master)](https://coveralls.io/github/bjornbytes/RxLua?branch=master)
===[Reactive Extensions](http://reactivex.io) 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:
```lua
local rx = require 'rx'
```You can also install RxLua using luarocks:
```sh
luarocks install bjornbytes/rxlua
```#### Luvit
Install using `lit`:
```sh
lit install bjornbytes/rx
```Then require it:
```lua
local rx = require 'rx'
```#### Love2D
See [RxLove](https://github.com/bjornbytes/RxLove).
Example Usage
---Use RxLua to construct a simple cheer:
```lua
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](examples) for more.
Resources
---- [Documentation](doc)
- [Contributor Guide](doc/CONTRIBUTING.md)
- [Rx Introduction](http://reactivex.io/intro.html)Tests
---Uses [lust](https://github.com/bjornbytes/lust). Run with:
```
lua tests/runner.lua
```or, to run a specific test:
```
lua tests/runner.lua skipUntil
```License
---MIT, see [`LICENSE`](LICENSE) for details.