Skip to content

feat: type documented events#25

Merged
kyranet merged 11 commits intomainfrom
feat/types/events
Aug 23, 2020
Merged

feat: type documented events#25
kyranet merged 11 commits intomainfrom
feat/types/events

Conversation

@Quantumlyy
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Status

Coverage increased (+1.4%) to 29.032% when pulling 88c6056 on feat/types/events into 7f7be02 on main.

Comment thread src/lib/types/Events.ts Outdated
@Quantumlyy Quantumlyy requested review from kyranet and removed request for kyranet August 23, 2020 08:35
Copy link
Copy Markdown
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question, can people still do client.on('unload', cb) and still get cb typed?

@Quantumlyy
Copy link
Copy Markdown
Contributor Author

Quantumlyy commented Aug 23, 2020

Just one question, can people still do client.on('unload', cb) and still get cb typed?

  1. It will be typed but with one downside, store will be unknown as the generic in Store does not default to anything. so it had to be unknown.
  2. The Events enum will have to be used, but it should be fine for JS users.

@kyranet
Copy link
Copy Markdown
Member

kyranet commented Aug 23, 2020

It will be typed but with one downside, store will be unknown as the generic in Store does not default to anything. so it had to be unknown.

You can define store as Store<Piece>, it's not abstract, so the type is accepted.

@Quantumlyy
Copy link
Copy Markdown
Contributor Author

It will be typed but with one downside, store will be unknown as the generic in Store does not default to anything. so it had to be unknown.

You can define store as Store<Piece>, it's not abstract, so the type is accepted.

Already tried it, but I will push it so you can see the error since it says Store does not fit Store.

@kyranet
Copy link
Copy Markdown
Member

kyranet commented Aug 23, 2020

@Quantumlyy Quantumlyy requested a review from kyranet August 23, 2020 09:15
@kyranet kyranet merged commit df95f00 into main Aug 23, 2020
@kyranet kyranet deleted the feat/types/events branch August 23, 2020 12:55
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.

2 participants