Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repeatWhen #38

Closed
thanegill opened this issue May 17, 2016 · 5 comments
Closed

repeatWhen #38

thanegill opened this issue May 17, 2016 · 5 comments

Comments

@thanegill
Copy link
Member

repeatWhen

Repeats an observable when another observable emits.

extension ObservableType {
    @warn_unused_result(message="http://git.io/rxs.uo")
    public func repeatWhen<O: ObservableConvertibleType>(@autoclosure notificationHandler: (() -> O)) -> Observable<E> {
        return notificationHandler()
            .asObservable()
            .flatMapLatest { _ in
                return self
            }
    }
}

Motivation for inclusion

ReactiveX/RxSwift#396

Example of use

Polling where the repetition intervals are not equal.

Could be one of the underlying operators for #15.

@fpillet
Copy link
Member

fpillet commented May 21, 2016

Sounds like a reasonable proposition! Like it.

@dchohfi
Copy link

dchohfi commented Apr 17, 2017

Is this going to be merged?

@fpillet
Copy link
Member

fpillet commented Apr 17, 2017

Will gladly merge - we just need some tests to go with! Thanks for the heads up

@danlozano
Copy link

+1 for this feature.

Need it to do polling.

@freak4pc
Copy link
Member

freak4pc commented May 6, 2018

I'm closing this for now due to inactivity - If you have any more comments on this subject, feel free to comment or ping me directly and I'll re-open it :) Thanks !

@freak4pc freak4pc closed this as completed May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants