ywana-core8 0.0.766 → 0.0.767
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/dist/index.cjs +19 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +19 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +19 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain2/CollectionContext.js +13 -5
package/package.json
CHANGED
@@ -18,15 +18,16 @@ export const CollectionContextProvider = (props) => {
|
|
18
18
|
const [queries, setQueries] = useState([])
|
19
19
|
const [selected, setSelected] = useState(null)
|
20
20
|
|
21
|
-
useEffect(() => {
|
22
|
-
console.log("CONTEXT LOAD for Filters", filters)
|
23
|
-
load()
|
21
|
+
useEffect(async () => {
|
22
|
+
console.log("CONTEXT LOAD for Filters START", filters)
|
23
|
+
await load()
|
24
|
+
console.log("CONTEXT LOAD for Filters END", filters)
|
24
25
|
}, [filters])
|
25
26
|
|
26
27
|
useEffect(() => {
|
27
28
|
if (Object.keys(customFilters).length > 0) {
|
28
|
-
console.log("CONTEXT
|
29
|
-
|
29
|
+
console.log("CONTEXT CustomFilters", customFilters)
|
30
|
+
filter()
|
30
31
|
}
|
31
32
|
}, [customFilters])
|
32
33
|
|
@@ -48,6 +49,13 @@ export const CollectionContextProvider = (props) => {
|
|
48
49
|
}
|
49
50
|
return
|
50
51
|
}
|
52
|
+
|
53
|
+
function filter() {
|
54
|
+
console.log("RUN CUSTOM FILTERS", customFilters)
|
55
|
+
const cfs = Object.values(customFilters)
|
56
|
+
const data = cfs.length ? cfs.reduce((acc, filter) => filter(acc), all) : all;
|
57
|
+
return data
|
58
|
+
}
|
51
59
|
|
52
60
|
async function select(id) {
|
53
61
|
if (fetching) {
|