Skip to content

Export observable (the symbol) under a different name or location. #6489

@benlesh

Description

@benlesh

I think this is unfortunate, because we might want to export something else as observable, and it's a bit confusing for people at times I imagine:

import { observable } from 'rxjs';

console.log(observable); // symbol

We're currently exporting our copy of Symbol.observable as observable from the main module. I think we should rename it, remove it, or move it under something else.

Options:

  1. Export it as observableSymbol or OBSERVABLE_SYMBOL
  2. Don't export it at all, and advise people to use a package like symbol-observable
  3. Export it as a static property of Observable or something. like Observable.SYMBOL. (minimal overhead there, it's more of stylistic thing, I'm not saying I like it. Just an option)
  4. ???? Something else.

In all cases we'd have to leave the observable export for the duration of 7.x, and simply deprecate it.

Metadata

Metadata

Assignees

Labels

7.xIssues and PRs for version 7.x8.xIssues and PRs for version 8.x

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions