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

feat(lib/es2021): Add type parameter to FinalizationRegistry #42274

Merged

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Jan 10, 2021

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jan 10, 2021
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@sandersn
Copy link
Member

There's a lot of discussion on that issue and the linked PR. Can you add an explanation of why the type parameter is important?

@ExE-Boss
Copy link
Contributor Author

Because it makes the heldValue that’s passed to the cleanupCallback correctly typed instead of using any.

@sandersn sandersn requested review from sandersn and orta January 16, 2021 00:46
@sandersn
Copy link
Member

Is typical usage going to allow the type parameter to be inferred? I think it is, but it would be nice to have a test.

@ExE-Boss
Copy link
Contributor Author

@sandersn I’ve added a test case based on IterableWeakMap from the TC39 WeakRef proposal with the fixes from tc39/proposal-weakrefs#216.

@ExE-Boss ExE-Boss force-pushed the lib/es2021/typed-finalization-registry branch from 3502962 to 9f8c895 Compare January 16, 2021 18:29
@ExE-Boss ExE-Boss force-pushed the lib/es2021/typed-finalization-registry branch from 9f8c895 to 4ac2a13 Compare February 7, 2021 15:42
@sandersn sandersn merged commit 0723904 into microsoft:master Feb 19, 2021
@ExE-Boss ExE-Boss deleted the lib/es2021/typed-finalization-registry branch February 19, 2021 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants