coroutine.lua 229 B

123456789
  1. local Rx = require 'rx'
  2. -- Observable created from a coroutine that produces two values.
  3. local cr = coroutine.create(function()
  4. coroutine.yield('hello')
  5. return 'world'
  6. end)
  7. Rx.Observable.fromCoroutine(cr):dump('coroutine')