@wordpress/core-data 4.0.2 → 4.0.3
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/README.md +1 -1
- package/build/actions.js +25 -29
- package/build/actions.js.map +1 -1
- package/build/entities.js +2 -1
- package/build/entities.js.map +1 -1
- package/build/index.js +0 -7
- package/build/index.js.map +1 -1
- package/build/queried-data/get-query-parts.js +2 -0
- package/build/queried-data/get-query-parts.js.map +1 -1
- package/build/resolvers.js +2 -14
- package/build/resolvers.js.map +1 -1
- package/build/selectors.js +22 -7
- package/build/selectors.js.map +1 -1
- package/build-module/actions.js +25 -28
- package/build-module/actions.js.map +1 -1
- package/build-module/entities.js +2 -1
- package/build-module/entities.js.map +1 -1
- package/build-module/index.js +0 -5
- package/build-module/index.js.map +1 -1
- package/build-module/queried-data/get-query-parts.js +2 -0
- package/build-module/queried-data/get-query-parts.js.map +1 -1
- package/build-module/resolvers.js +12 -24
- package/build-module/resolvers.js.map +1 -1
- package/build-module/selectors.js +20 -5
- package/build-module/selectors.js.map +1 -1
- package/package.json +10 -11
- package/src/actions.js +32 -47
- package/src/entities.js +1 -0
- package/src/index.js +0 -3
- package/src/queried-data/get-query-parts.js +2 -0
- package/src/resolvers.js +12 -24
- package/src/selectors.js +100 -31
- package/src/test/actions.js +27 -37
- package/build/controls.js +0 -44
- package/build/controls.js.map +0 -1
- package/build-module/controls.js +0 -31
- package/build-module/controls.js.map +0 -1
- package/src/controls.js +0 -31
package/build-module/controls.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { createRegistryControl } from '@wordpress/data';
|
|
5
|
-
export function regularFetch(url) {
|
|
6
|
-
return {
|
|
7
|
-
type: 'REGULAR_FETCH',
|
|
8
|
-
url
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export function getDispatch() {
|
|
12
|
-
return {
|
|
13
|
-
type: 'GET_DISPATCH'
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
const controls = {
|
|
17
|
-
async REGULAR_FETCH({
|
|
18
|
-
url
|
|
19
|
-
}) {
|
|
20
|
-
const {
|
|
21
|
-
data
|
|
22
|
-
} = await window.fetch(url).then(res => res.json());
|
|
23
|
-
return data;
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
GET_DISPATCH: createRegistryControl(({
|
|
27
|
-
dispatch
|
|
28
|
-
}) => () => dispatch)
|
|
29
|
-
};
|
|
30
|
-
export default controls;
|
|
31
|
-
//# sourceMappingURL=controls.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/core-data/src/controls.js"],"names":["createRegistryControl","regularFetch","url","type","getDispatch","controls","REGULAR_FETCH","data","window","fetch","then","res","json","GET_DISPATCH","dispatch"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,qBAAT,QAAsC,iBAAtC;AAEA,OAAO,SAASC,YAAT,CAAuBC,GAAvB,EAA6B;AACnC,SAAO;AACNC,IAAAA,IAAI,EAAE,eADA;AAEND,IAAAA;AAFM,GAAP;AAIA;AAED,OAAO,SAASE,WAAT,GAAuB;AAC7B,SAAO;AACND,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED,MAAME,QAAQ,GAAG;AAChB,QAAMC,aAAN,CAAqB;AAAEJ,IAAAA;AAAF,GAArB,EAA+B;AAC9B,UAAM;AAAEK,MAAAA;AAAF,QAAW,MAAMC,MAAM,CAC3BC,KADqB,CACdP,GADc,EAErBQ,IAFqB,CAEbC,GAAF,IAAWA,GAAG,CAACC,IAAJ,EAFI,CAAvB;AAIA,WAAOL,IAAP;AACA,GAPe;;AAShBM,EAAAA,YAAY,EAAEb,qBAAqB,CAAE,CAAE;AAAEc,IAAAA;AAAF,GAAF,KAAoB,MAAMA,QAA5B;AATnB,CAAjB;AAYA,eAAeT,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistryControl } from '@wordpress/data';\n\nexport function regularFetch( url ) {\n\treturn {\n\t\ttype: 'REGULAR_FETCH',\n\t\turl,\n\t};\n}\n\nexport function getDispatch() {\n\treturn {\n\t\ttype: 'GET_DISPATCH',\n\t};\n}\n\nconst controls = {\n\tasync REGULAR_FETCH( { url } ) {\n\t\tconst { data } = await window\n\t\t\t.fetch( url )\n\t\t\t.then( ( res ) => res.json() );\n\n\t\treturn data;\n\t},\n\n\tGET_DISPATCH: createRegistryControl( ( { dispatch } ) => () => dispatch ),\n};\n\nexport default controls;\n"]}
|
package/src/controls.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { createRegistryControl } from '@wordpress/data';
|
|
5
|
-
|
|
6
|
-
export function regularFetch( url ) {
|
|
7
|
-
return {
|
|
8
|
-
type: 'REGULAR_FETCH',
|
|
9
|
-
url,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function getDispatch() {
|
|
14
|
-
return {
|
|
15
|
-
type: 'GET_DISPATCH',
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const controls = {
|
|
20
|
-
async REGULAR_FETCH( { url } ) {
|
|
21
|
-
const { data } = await window
|
|
22
|
-
.fetch( url )
|
|
23
|
-
.then( ( res ) => res.json() );
|
|
24
|
-
|
|
25
|
-
return data;
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
GET_DISPATCH: createRegistryControl( ( { dispatch } ) => () => dispatch ),
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default controls;
|