Skip to content

Conversation

@IdoBouskila
Copy link

@IdoBouskila IdoBouskila commented Apr 4, 2025

Remove empty property from SlotKey type because the property doesn't really exist at runtime, so we're ensuring type definitions accurately reflect the actual object structure in runtime

Playground: https://tsplay.dev/wgO8yw

…face

Remove `empty` property from an `SlotKey` type because  the property doesn't really exist at runtime,so we're
ensuring type definitions accurately reflect the actual object structure.
* Holds no value, only triggers type-checking of T
*/
readonly empty?: T
export interface SlotKey<_T> extends AnySlotKey {
Copy link
Author

Choose a reason for hiding this comment

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

The underscore prefix (_T ) is used to tell TS to ignore unused parameters :)

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.

1 participant