Пример:
Code: Select all
local Rx = require 'rx'
Rx.Observable.fromRange(1, 8)
:filter(function(x) return x % 2 == 0 end)
:concat(Rx.Observable.fromValue('who do we appreciate'))
:map(function(value) return value .. '!' end)
:subscribe(print)
-- => 2! 4! 6! 8! who do we appreciate!