Skip to content

Interest in a compactScan operator ? #98

Open
@twittemb

Description

@twittemb

Hi everyone,

lately I faced a use case where a reducer function that I pass to a “scan” operator could return an optional.

the expected behaviour was: if the function returns nil then there is no change made in the accumulator and the scan operator continues with the next values.

the signature would be something like:

compactScan(initial: A, _ nextPartialResult: (A, Output) -> A?) -> AnyPublisher<A, Failure>

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    operatorquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions