2018-11-29 15:57:49 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2019-05-20 20:50:25 +00:00
|
|
|
import imports from './imports';
|
2018-11-29 15:57:49 +00:00
|
|
|
|
|
|
|
function createWcApiSpec() {
|
|
|
|
return {
|
2019-04-09 14:55:01 +00:00
|
|
|
name: 'wcApi',
|
2020-08-20 23:37:41 +00:00
|
|
|
mutations: {},
|
2018-11-29 15:57:49 +00:00
|
|
|
selectors: {
|
2019-05-20 20:50:25 +00:00
|
|
|
...imports.selectors,
|
2018-11-29 15:57:49 +00:00
|
|
|
},
|
|
|
|
operations: {
|
|
|
|
read( resourceNames ) {
|
2019-06-10 22:03:08 +00:00
|
|
|
if ( document.hidden ) {
|
|
|
|
// Don't do any read updates while the tab isn't active.
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
2020-08-20 23:37:41 +00:00
|
|
|
return [ ...imports.operations.read( resourceNames ) ];
|
2018-11-29 15:57:49 +00:00
|
|
|
},
|
2020-08-20 23:37:41 +00:00
|
|
|
update() {
|
|
|
|
return [];
|
2018-12-13 19:24:54 +00:00
|
|
|
},
|
2020-08-20 23:37:41 +00:00
|
|
|
updateLocally() {
|
|
|
|
return [];
|
2019-06-27 09:21:43 +00:00
|
|
|
},
|
2018-11-29 15:57:49 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default createWcApiSpec();
|