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

[weak-memoize] Convert to TypeScript #2429

Merged

Conversation

sarayourfriend
Copy link
Contributor

What:

Converts weak-memoize to TypeScript.

Why:

Part of #2358

How:

Rename index.js to index.ts and add types.

Checklist:

  • Documentation N/A
  • Tests
  • Code complete
  • Changeset

Requires some changes from #2427 to get the jest tests to run, but figured I'd put this one anyway to get it started.

@changeset-bot
Copy link

changeset-bot bot commented Jul 13, 2021

🦋 Changeset detected

Latest commit: 9ab2cf1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@emotion/weak-memoize Minor
@emotion/cache Patch
@emotion/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sarayourfriend
Copy link
Contributor Author

Not sure what happened to the codesandbox. Going to the details link results in a 504 timeout 🤷

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9ab2cf1:

Sandbox Source
Emotion Configuration

@Andarist Andarist merged commit b1d16b0 into emotion-js:ts-migration Aug 14, 2021
Comment on lines 7 to 9
// Use non-null assertion because we just checked that the cache `has` it
// This allows us to remove `undefined` from the return value
return cache.get(arg) as Return
return cache.get(arg)!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, TIL about the non-null assertion, thank you @Andarist

@github-actions github-actions bot mentioned this pull request May 17, 2024
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