Skip to content

Change order of parameters on Observable.while #52

@mattpodwysocki

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions