Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Symbol.for to create Symbol.observable if it does not exist. #9

Merged
merged 1 commit into from
Apr 26, 2016

Conversation

jamestalmage
Copy link
Contributor

This is the method used by symbol-observable and other packages (including RxJs/Observables).

The current usage is causing false negatives from the is-observable package in latest Node.

This is the method used by `symbol-observable` and other packages (including RxJs/Observables).

The current usage is causing false negatives from the `is-observable` package in latest Node.
@sindresorhus
Copy link

Maybe zen-observable could just use https://github.com/blesh/symbol-observable? // @Blesh

@zenparsing
Copy link
Owner

That would probably be better.

@jamestalmage
Copy link
Contributor Author

Oh dear. symbol-observable just changed their way of doing it. It now explicitly does NOT use Symbol.for: benlesh/symbol-observable#7

I considered recommending symbol-observable - but you were dependency free, so thought that might be a priority.

@zenparsing
Copy link
Owner

I like dependency-free : )

I'll comment over on symbol-observable.

@sindresorhus
Copy link

You could always just copy-paste it. I'm more concerned about consistent behavior.

@benlesh
Copy link

benlesh commented Apr 26, 2016

@zenparsing you might want to roll this one back, as it doesn't match prior art like Symbol.iterator.

Symbol.iterator === Symbol.for('iterator'); // false

@benlesh
Copy link

benlesh commented Apr 26, 2016

... or just use symbol-observable, as @sindresorhus suggested. lol

@jamestalmage
Copy link
Contributor Author

You could always just copy-paste

I basically did. It just changed a day later

@jamestalmage
Copy link
Contributor Author

jamestalmage commented Apr 26, 2016

you might want to roll this one back, as it doesn't match prior art like Symbol.iterator.

Yeah, but which one is right? Who decides this stuff? It seems really important to get it right, better to do it now. Who pushed the Symbol spec through? Let's ask them.

@benlesh
Copy link

benlesh commented Apr 26, 2016

Yeah, but which one is right?

WRT Symbol.iterator The existing one is "right", for better or worse. It's in the wild and is not going to change.

Who decides this stuff?

The TC39, after exhaustive discussion and debate, I suppose.

Who pushed the Symbol spec through? Let's ask them.

People like @zenparsing and friends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants