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 transition typings #190

Merged
merged 1 commit into from
May 31, 2018
Merged

Conversation

mattyclarkson
Copy link
Contributor

Allows assigning multiple transition prooperties now. keyof S[]
is the keys of an array of the generic property which is length,
etc.

Allows assigning multiple transition prooperties now. `keyof S[]`
is the keys of an array of the generic property which is `length`,
etc.
@mattyclarkson
Copy link
Contributor Author

@aminroosta does this make sense to you? You added the original typings. I couldn't pass an array of transition strings without his change.

@aminroosta
Copy link
Contributor

@mattyclarkson according to this stackoverflow question (Array<Type> vs Type[]), i think both keyof s[] and Array<keyof s> should be equivalent. Now that the keyof s[] is not working let's use Array<keyof s>.

LGTM 👍

@mattyclarkson
Copy link
Contributor Author

@aminroosta I think in the general case that is correct. However, I don't know the precedence of the keyof operator in the type system. Is keyof S[] interpreted as *the keys of an array of S (i.e. "length" | "push" | "etc") * or an array of keys of S (i.e. ["color" | "etc"]). I think I was hitting the former, when we need the latter. Array<keyof S> removes the ambiguity. I think (keyof S)[] would do the same thing, maybe. Thanks for the approval 😄

@oblador oblador merged commit 4076b87 into oblador:master May 31, 2018
@mattyclarkson mattyclarkson deleted the fix-transition-typings branch May 31, 2018 19:56
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.

3 participants