RxLua/examples/coroutine.lua
2015-07-15 00:47:23 -07:00

10 lines
229 B
Lua

local Rx = require 'rx'
-- Observable created from a coroutine that produces two values.
local cr = coroutine.create(function()
coroutine.yield('hello')
return 'world'
end)
Rx.Observable.fromCoroutine(cr):dump('coroutine')