Skip to content

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

@bfrolicher

Description

@bfrolicher

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions