Skip to content

Deprecate the partition operator #3797

@benlesh

Description

@benlesh

I think we should deprecate the partition operator and remove it for v7.

Reasons:

  1. Not really an operator: partition isn't really an "operator" in that it returns [Observable<T>, Observable<T>] rather than Observable<T>. This means it doesn't compose via pipe like the others.
  2. Easy to replace with filter: partition is easily replaced with the much more widely known filter operator. As partition is effectively the same thing as: const partition = (predicate) => [source.pipe(filter(predicate)), source.pipe(filter((x, i) => !predicate(x, i)))]
  3. Rarely used: It's little used, by any code survey I've taken (within thousands of lines of code that I know use RxJS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions