feat(cache): implement caching for intl data#235
feat(cache): implement caching for intl data#235dvlin-dev wants to merge 2 commits intoalibaba:masterfrom
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.
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.