-
Notifications
You must be signed in to change notification settings - Fork 155
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(cache): implement caching for intl data #235
base: master
Are you sure you want to change the base?
Conversation
First of all, thanks for spending time on this project. Is it possible to make the cache feature optional by parameter? I would like it to be disabled by default for the following reasons:
|
Additionally, is it possible to use the cache mechanism offered by https://formatjs.io/docs/intl/#createintlcache? |
I submitted the code again, according to your request, make cache optional, refer to formatjs |
The changes to the init method parameters need to be synchronized in the README.md file, just like defined in index.d.ts. However, the README.md file is ignored in the .gitignore file. Should I delete the README.md option in the .gitignore file, or should you synchronize the changes of the init parameter? |
I am very happy to be able to contribute (: |
hi bro, maybe you can have a look at of this,I will use the feature plz. |
Bump |
* @returns {Promise} | ||
*/ | ||
init(options = {}) { | ||
init(options = {}, cache) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you create cache object internally by adding a enableCache
as one of options?
init(options) {
if(options.enableCache) {
// create cache object internally
}
}
Description
add cache
Fixes #232
Type of change
New feature (non-breaking change which adds functionality)
Test
First call intl.get once, and then check if there is a corresponding value in the cache.