Observable icon indicating copy to clipboard operation
Observable copied to clipboard

[Feature] observable.skip(count: Int) method

Open bfrolicher opened this issue 3 years ago • 0 comments

Hi,

Is a skip method possible ?

This could simplify unit test and some edge case where first or more value must be ignore.

First I can simply change

public func observe(_ queue: DispatchQueue? = nil, _ observer: @escaping Observer) -> Disposable 

to

public func observe(_ queue: DispatchQueue? = nil, skipFirst: Bool = false,  _ observer: @escaping Observer) -> Disposable 

This could solve the first emitted null value when using Observable(String?) = Observable(nil)

But i can't add skip(count: Int) method without a lot of changes, maybe due to a lack of knowledge about the library.

✌️ Ben

bfrolicher avatar Jul 20 '20 18:07 bfrolicher