Skip to content

Fix transition typings#190

Merged
oblador merged 1 commit intooblador:masterfrom
mattyclarkson:fix-transition-typings
May 31, 2018
Merged

Fix transition typings#190
oblador merged 1 commit intooblador:masterfrom
mattyclarkson:fix-transition-typings

Conversation

@mattyclarkson
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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