Skip to content

Commit

Permalink
v3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Charette authored and Frederic Charette committed Jun 20, 2022
1 parent bf6071c commit 7f1ce32
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tests
README.md
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Expand All @@ -8,4 +7,6 @@ CONTRIBUTING.md
package-lock.json
*.clinic*
sample.txt
.github
.github
logo.png
yarn.lock
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1 align="center">
<img alt="HA-store" width="300px" src="./logo.png" />
<br/>
High-Availability store
</h1>
<h3 align="center">
Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ha-store",
"version": "3.1.1",
"version": "3.2.0",
"description": "Efficient data fetching",
"main": "src/index.js",
"scripts": {
Expand Down Expand Up @@ -36,11 +36,11 @@
"license": "Apache-2.0",
"devDependencies": {
"chai": "^4.3.0",
"eslint": "^7.29.0",
"eslint": "^8.18.0",
"ha-store-redis": "^2.0.1",
"mocha": "^9.0.0",
"sinon": "^11.1.0",
"split2": "^3.2.0"
"mocha": "^10.0.0",
"sinon": "^14.0.0",
"split2": "^4.1.0"
},
"contributors": [
"frederic charette <[email protected]>",
Expand All @@ -49,6 +49,6 @@
],
"typings": "./src/index.d.ts",
"dependencies": {
"lru-cache": "^6.0.0"
"lru-cache": "^7.10.0"
}
}
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ class HaStore extends EventEmitter {

this.config = hydrateConfig(initialConfig);

if (this.setMaxListeners) {
this.setMaxListeners(Infinity);
}

this.store = this.config.cache ? this.config.store(this.config) : null;
this.storeGetMulti = (key, ids) => this.store.getMulti(contextRecordKey(key), ids);
this.storeGet = (key, id) => ([ this.store.get(recordKey(key, id)) ]);
Expand Down
8 changes: 4 additions & 4 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const lru = require('lru-cache');
function localStore(config) {
const store = new lru({
max: config.cache.limit,
maxAge: config.cache.ttl,
ttl: config.cache.ttl,
});

function get(key) {
Expand All @@ -30,14 +30,14 @@ function localStore(config) {

function clear(key) {
if (key === '*') {
store.reset();
store.clear();
return true;
}
return store.del(key);
return store.delete(key);
}

function size() {
return store.itemCount;
return store.size;
}

return { get, getMulti, set, clear, size };
Expand Down

0 comments on commit 7f1ce32

Please sign in to comment.