Skip to content

Instantly share code, notes, and snippets.

@jredville
Created February 13, 2014 16:12
Show Gist options
  • Save jredville/8978041 to your computer and use it in GitHub Desktop.
Save jredville/8978041 to your computer and use it in GitHub Desktop.
Observable.generate do
initial_state 0
condition {|x| x <= 3}
result_selector {|x| x + 1}
iterator {|x| x }
scheduler RX::TestScheduler.new
end
# OR
Observable.generate do
initial_state 0
iterate_while {|x| x <= 3}
select_result_with {|x| x + 1}
iterate_with {|x| x }
scheduler RX::TestScheduler.new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment