Skip to content

Change order of parameters on Observable.while #52

Description

@mattpodwysocki

@jca02266 should we change the order of the parameter on #while so that we could use a block instead?

require 'rx'

i = 0

# Repeat until condition no longer holds
source = RX::Observable.while(RX::Observable.just 42) { i += 1; i <= 3 }

subscription = source.subscribe(
    lambda {|x|
        puts 'Next: ' + x.to_s
    },
    lambda {|err|
        puts 'Error: ' + err.to_s
    },
    lambda {
        puts 'Completed'
    })

# => Next: 42
# => Next: 42
# => Next: 42
# => Completed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions