@pagopa/selfcare-common-frontend 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/build.info +2 -2
- package/hooks/useReduxCachedValue.d.ts +1 -1
- package/hooks/useReduxCachedValue.js +1 -1
- package/hooks/useReduxCachedValue.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v1.5.5](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.4...v1.5.5)
|
|
8
|
+
|
|
9
|
+
- useReduxCachedValueTranscoded transcode function will accept retrieverServiceArgs [`#30`](https://github.com/pagopa/selfcare-common-frontend/pull/30)
|
|
10
|
+
|
|
7
11
|
#### [v1.5.4](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.3...v1.5.4)
|
|
8
12
|
|
|
13
|
+
> 15 February 2022
|
|
14
|
+
|
|
9
15
|
- fixed useReduxCachedValueTranscoded parameters types [`#29`](https://github.com/pagopa/selfcare-common-frontend/pull/29)
|
|
10
16
|
|
|
11
17
|
#### [v1.5.3](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.2...v1.5.3)
|
package/README.md
CHANGED
|
@@ -222,7 +222,7 @@ The arguments to provide to the custom hook are the following:
|
|
|
222
222
|
| retrieverService | (retrieverServiceArgs: RETRIEVER_ARGS) => Promise`<RETRIEVED_VALUE>` | Y | The service that will retrieve the value |
|
|
223
223
|
| reduxSelector | (state: any) => STORED_VALUE | undefined | Y | The selector to read the value from redux |
|
|
224
224
|
| reduxSetterAction | (value: RETRIEVED_VALUE, retrieverServiceArgs: RETRIEVER_ARGS) => PayloadAction`<STORED_VALUE>` | Y | The action to store the value |
|
|
225
|
-
| selectedValue2RetrievedValue | (value: STORED_VALUE) => RETRIEVED_VALUE | Y | A function called to transform STORED_VALUE into RETRIEVED_VALUE and called when hitting the cache |
|
|
225
|
+
| selectedValue2RetrievedValue | (value: STORED_VALUE, args: RETRIEVER_ARGS) => RETRIEVED_VALUE | Y | A function called to transform STORED_VALUE into RETRIEVED_VALUE and called when hitting the cache |
|
|
226
226
|
| selectedValuePredicate2Retrieve | (value: STORED_VALUE, retrieverServiceArgs: RETRIEVER_ARGS) => boolean | N | An optional predicate evaluated when reduxSelector returned some value in order to compare it against the retrieverServiceArgs and evaluate if retrieverService should be called again |
|
|
227
227
|
| alwaysRetrieve | boolean | N | If true, it will always retrieve and store the new value |
|
|
228
228
|
|
package/build.info
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
20220215.
|
|
2
|
-
tags/v1.5.
|
|
1
|
+
20220215.3 - selfcare-common-frontend.deploy(20507)
|
|
2
|
+
tags/v1.5.5^0 53f03f574a66373756e3ebd2907ead3dc6fedc27
|
|
@@ -5,5 +5,5 @@ declare const useReduxCachedValue: <RETRIEVED_VALUE, RETRIEVER_ARGS>(entity: str
|
|
|
5
5
|
export declare const useReduxCachedValueTranscoded: <RETRIEVED_VALUE, STORED_VALUE, RETRIEVER_ARGS>(entity: string, retrieverService: (retrieverServiceArgs: RETRIEVER_ARGS) => Promise<RETRIEVED_VALUE>, reduxSelector: (state: any) => STORED_VALUE | undefined, reduxSetterAction: (value: RETRIEVED_VALUE, retrieverServiceArgs: RETRIEVER_ARGS) => {
|
|
6
6
|
payload: STORED_VALUE;
|
|
7
7
|
type: string;
|
|
8
|
-
}, selectedValue2RetrievedValue: (value: STORED_VALUE) => RETRIEVED_VALUE, selectedValuePredicate2Retrieve?: ((value: STORED_VALUE, args: RETRIEVER_ARGS) => boolean) | undefined, alwaysRetrieve?: boolean | undefined) => (retrieverServiceArgs: RETRIEVER_ARGS) => Promise<RETRIEVED_VALUE>;
|
|
8
|
+
}, selectedValue2RetrievedValue: (value: STORED_VALUE, args: RETRIEVER_ARGS) => RETRIEVED_VALUE, selectedValuePredicate2Retrieve?: ((value: STORED_VALUE, args: RETRIEVER_ARGS) => boolean) | undefined, alwaysRetrieve?: boolean | undefined) => (retrieverServiceArgs: RETRIEVER_ARGS) => Promise<RETRIEVED_VALUE>;
|
|
9
9
|
export default useReduxCachedValue;
|
|
@@ -41,7 +41,7 @@ alwaysRetrieve) => {
|
|
|
41
41
|
.finally(() => setLoading(false));
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
|
-
return new Promise((resolve) => resolve(selectedValue2RetrievedValue(entities)));
|
|
44
|
+
return new Promise((resolve) => resolve(selectedValue2RetrievedValue(entities, retrieverServiceArgs)));
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReduxCachedValue.js","sourceRoot":"","sources":["../../src/lib/hooks/useReduxCachedValue.tsx"],"names":[],"mappings":";;;;AACA,6CAAuD;AACvD,kDAAyE;AACzE,2EAAsC;AAEtC,uEAAuE;AACvE,MAAM,mBAAmB,GAAG,CAC1B,MAAc,EACd,gBAAoF,EACpF,aAA0D,EAC1D,iBAGuB,EACvB,+BAA2F,EAC3F,cAAwB,EAC8C,EAAE,CACxE,IAAA,qCAA6B,EAC3B,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAChB,+BAA+B,EAC/B,cAAc,CACf,CAAC;AAEJ,sJAAsJ;AAC/I,MAAM,6BAA6B,GAAG;AAC3C,4DAA4D;AAC5D,MAAc;AACd,+CAA+C;AAC/C,gBAAoF;AACpF,gDAAgD;AAChD,aAAuD;AACvD,wCAAwC;AACxC,iBAGgC;AAChC,yGAAyG;AACzG,
|
|
1
|
+
{"version":3,"file":"useReduxCachedValue.js","sourceRoot":"","sources":["../../src/lib/hooks/useReduxCachedValue.tsx"],"names":[],"mappings":";;;;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AAC,EAAE,oBAAoB,CAAC,CAAC;gBACrC,OAAO,CAAC,CAAC;YACX,CAAC,CAAC;iBACD,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;SACrC;aAAM;YACL,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC7B,OAAO,CAAC,4BAA4B,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CACtE,CAAC;SACH;IACH,CAAC,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,6BAA6B,iCA8CxC;AAEF,kBAAe,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagopa/selfcare-common-frontend",
|
|
3
3
|
"description": "Shared React components for the pagopa selfcare project",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/pagopa/selfcare-common-frontend",
|
|
7
7
|
"author": "https://www.pagopa.gov.it",
|