depay-blockchain-call
Advanced tools
Comparing version
@@ -13,2 +13,6 @@ 'use strict'; | ||
let resetCache = () => { | ||
cacheStore = {}; | ||
}; | ||
let set = function ({ key, value, expires }) { | ||
@@ -86,3 +90,3 @@ cacheStore[key] = { | ||
let args = fragment.inputs.map((input, index) => { | ||
if(Array.isArray(params)) { | ||
if (Array.isArray(params)) { | ||
return params[index] | ||
@@ -135,1 +139,2 @@ } else { | ||
exports.provider = provider$1; | ||
exports.resetCache = resetCache; |
@@ -5,2 +5,6 @@ import ethers from 'ethers'; | ||
let resetCache = () => { | ||
cacheStore = {}; | ||
}; | ||
let set = function ({ key, value, expires }) { | ||
@@ -78,3 +82,3 @@ cacheStore[key] = { | ||
let args = fragment.inputs.map((input, index) => { | ||
if(Array.isArray(params)) { | ||
if (Array.isArray(params)) { | ||
return params[index] | ||
@@ -125,2 +129,2 @@ } else { | ||
export { call$1 as call, provider$1 as provider }; | ||
export { call$1 as call, provider$1 as provider, resetCache }; |
@@ -13,2 +13,6 @@ (function (global, factory) { | ||
let resetCache = () => { | ||
cacheStore = {}; | ||
}; | ||
let set = function ({ key, value, expires }) { | ||
@@ -86,3 +90,3 @@ cacheStore[key] = { | ||
let args = fragment.inputs.map((input, index) => { | ||
if(Array.isArray(params)) { | ||
if (Array.isArray(params)) { | ||
return params[index] | ||
@@ -135,2 +139,3 @@ } else { | ||
exports.provider = provider$1; | ||
exports.resetCache = resetCache; | ||
@@ -137,0 +142,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
{ | ||
"name": "depay-blockchain-call", | ||
"moduleName": "BlockchainCall", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "dist/cjs/index.js", |
@@ -123,2 +123,18 @@ Stop relying on connected wallets when fetching data for dApps. | ||
### resetCache | ||
Make sure you reset cache between your tests to prevent cached states affect others tests: | ||
```javascript | ||
import { call, resetCache } from 'depay-blockchain-call' | ||
describe('resetCache', ()=>{ | ||
beforeEach(resetCache) | ||
//... | ||
}) | ||
``` | ||
## Development | ||
@@ -125,0 +141,0 @@ |
66893
0.73%334
3.41%153
11.68%