Skip to content

Switch to config objects for operators with a lot of arguments. #3515

@benlesh

Description

@benlesh

There are a few operators that have a lot of arguments, one example would be groupBy. This hurts readability a bit and also bites us later if we want to change or deprecate arguments.

So the idea is simple, introduce non-breaking changes to operators like groupBy to allow the passing of a config object to essentially provide "named arguments":

groupBy(fn1, fn2 fn3, fn4)

// becomes

groupBy({
  keySelector: fn1,
  resultSelector: fn2,
  durationSelector: fn3,
  subjectFactory: fn4,
})

(The names can be bikeshedded later, ideally to make it more terse but still readable)

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