Cache M Fixo
This commit is contained in:
parent
2dafba786d
commit
e3c5642027
4 changed files with 11 additions and 2 deletions
|
|
@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
||||||
var cacheMemoria_exports = {};
|
var cacheMemoria_exports = {};
|
||||||
__export(cacheMemoria_exports, {
|
__export(cacheMemoria_exports, {
|
||||||
cacheM: () => cacheM,
|
cacheM: () => cacheM,
|
||||||
|
cacheMFixo: () => cacheMFixo,
|
||||||
cacheMemoria: () => cacheMemoria,
|
cacheMemoria: () => cacheMemoria,
|
||||||
verCacheM: () => verCacheM
|
verCacheM: () => verCacheM
|
||||||
});
|
});
|
||||||
|
|
@ -41,9 +42,11 @@ const cacheM = (chave, valor, validadeSeg) => {
|
||||||
};
|
};
|
||||||
const verCacheM = () => _cache;
|
const verCacheM = () => _cache;
|
||||||
const cacheMemoria = cacheM;
|
const cacheMemoria = cacheM;
|
||||||
|
const cacheMFixo = (chave) => (valor) => cacheM(chave, valor);
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
0 && (module.exports = {
|
0 && (module.exports = {
|
||||||
cacheM,
|
cacheM,
|
||||||
|
cacheMFixo,
|
||||||
cacheMemoria,
|
cacheMemoria,
|
||||||
verCacheM
|
verCacheM
|
||||||
});
|
});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "p-comuns",
|
"name": "p-comuns",
|
||||||
"version": "0.206.0",
|
"version": "0.207.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./dist-back/index.js",
|
"main": "./dist-back/index.js",
|
||||||
"module": "./dist-front/index.mjs",
|
"module": "./dist-front/index.mjs",
|
||||||
|
|
|
||||||
|
|
@ -43,3 +43,9 @@ export const cacheM = <T>(
|
||||||
export const verCacheM = () => _cache
|
export const verCacheM = () => _cache
|
||||||
|
|
||||||
export const cacheMemoria = cacheM
|
export const cacheMemoria = cacheM
|
||||||
|
|
||||||
|
/** para uso fixo dentro de uma função, trava a chave */
|
||||||
|
export const cacheMFixo =
|
||||||
|
(chave: any) =>
|
||||||
|
<T>(valor?: T) =>
|
||||||
|
cacheM(chave, valor)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue