Coder Social home page Coder Social logo

rxlua's 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.

rxlua's People

Contributors

4o4 avatar bjornbytes avatar bonzini avatar greatwolf avatar lorel avatar naxxster avatar potcfdk avatar strangepan avatar titouanc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.