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

fix(types): use default syntax for typedef #11

Closed
wants to merge 1 commit into from

Conversation

robwormald
Copy link
Contributor

this will enable projects consuming symbol-observable from TS (eg, RxJS) to use

import $$observable from 'symbol-observable'

rather than

import * as $$observable from 'symbol-observable'

This might? require downstream changes on RxJS but its more correct methinks.

this will enable projects consuming symbol-observable from TS (eg, RxJS) to use
```typescript
import $$observable from 'symbol-observable'
```
rather than
```typescript
import * as $$observable from 'symbol-observable'
```

This might? require downstream changes on RxJS but its more correct methinks.
@kwonoj
Copy link
Contributor

kwonoj commented May 27, 2016

👍 I think that one's my bad.. :/

@SamVerschueren
Copy link
Collaborator

SamVerschueren commented May 27, 2016

I don't think changing the d.ts file is enough. TypeScript expects the default property on the exported object. So I believe this line should be changed to something like this:

var ponyfill = require('./ponyfill')(root);
module.exports = ponyfill;
module.exports.default = ponyfill;

More info: microsoft/TypeScript#2242 (comment)

@benlesh
Copy link
Owner

benlesh commented May 27, 2016

@robwormald did you test this? Do we have tests for this? How do we test this? haha. It LGTM... I just want to be sure.

@jamestalmage
Copy link
Collaborator

You test it by actually using typescript and the typescript compiler and verifying you get no type warnings / errors.

@benlesh
Copy link
Owner

benlesh commented May 28, 2016

You test it by actually using typescript and the typescript compiler and verifying you get no type warnings / errors.

Yes... I know, I'm just travelling and I was hoping to prompt someone else into adding it. :) haha

Too subtle, I guess.

@robwormald
Copy link
Contributor Author

Maybe don't merge this yet, the behavior is kinda weird. I'll work through it this weekend.

@benlesh
Copy link
Owner

benlesh commented May 28, 2016

I just tested this, and it doesn't work properly in TypeScript.

@benlesh
Copy link
Owner

benlesh commented May 28, 2016

the import is undefined

@benlesh
Copy link
Owner

benlesh commented May 28, 2016

Closing in favor of #12, which adds a test (that is currently failing)

@benlesh benlesh closed this May 28, 2016
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.

5 participants