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(cacheing): Include namespace in formatting cache key #58

Merged
merged 5 commits into from
Sep 17, 2021
Merged

fix(cacheing): Include namespace in formatting cache key #58

merged 5 commits into from
Sep 17, 2021

Conversation

mismosmi
Copy link
Contributor

@mismosmi mismosmi commented Sep 16, 2021

Fixes #57

@mismosmi mismosmi changed the title Include namespace in formatting cache key fix(cacheing): Include namespace in formatting cache key Sep 16, 2021
Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

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

Thanks a lot for looking into this @mismosmi!

Your solution looks good to me, I'd just handle the case where we don't have a namespace a bit more explicit, so undefined doesn't end up in the cache key.

Can you also apply the suggestions from ESLint? Most of them should be auto-fixable.

packages/use-intl/src/useTranslations.tsx Outdated Show resolved Hide resolved
packages/use-intl/test/useTranslations.test.tsx Outdated Show resolved Hide resolved
mismosmi and others added 3 commits September 17, 2021 11:26
The caching should be a implementation detail here

Co-authored-by: Jan Amann <jan@amann.me>
@mismosmi
Copy link
Contributor Author

I applied all your suggestions.
Sorry for eslint, usually vscode bugs me with these things, I don't know what went wrong.

Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

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

Thanks a lot, looks good to me!

@amannn amannn merged commit b8f7dab into amannn:main Sep 17, 2021
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.

Does not re-render when namespace changes
2 participants