• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

bjornbytes/RxLua: Reactive Extensions for Lua

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

bjornbytes/RxLua

开源软件地址(OpenSource Url):

https://github.com/bjornbytes/RxLua

开源编程语言(OpenSource Language):

Lua 100.0%

开源软件介绍(OpenSource Introduction):

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
facebookarchive/luaffifb: FFI package for Lua 5.1 and Lua 5.2发布时间:2022-08-16
下一篇:
Neopallium/lua-pb: Lua Protocol Buffers发布时间:2022-08-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap