Skip to content

Provide side-effect-free version of operators #860

Closed
@jeffbcross

Description

@jeffbcross

Right now each of the operator modules contain both the operator implementation AND the Observable-patching side effect logic. This prevents smart people like me from being able to safely import an operator without polluting the Observable prototype.

I think the right default behavior is to keep the side-effect-producing modules named as they already are, in the operators folder, and import from a "raw" module that exports the operator implementation.

I propose adding an implementation folder inside operators to contain actual implementations.

|- rxjs/
|-- operators/
|---- implementation/
|------ map.ts - actual implementation with no side effects
|---- map.ts // Just imports the raw `map` operator and patches it onto Observable

CC @robwormald @Blesh @IgorMinar

Metadata

Metadata

Assignees

Labels

featurePRs and issues for features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions