Skip dispatching fresh data requests when the window/tab is hidden.
This commit is contained in:
parent
4e9f787b13
commit
b23ae97eff
|
@ -19,6 +19,9 @@ function createStore( name ) {
|
|||
function createDataHandlers( store ) {
|
||||
return {
|
||||
dataRequested: resourceNames => {
|
||||
if ( document.hidden ) {
|
||||
return;
|
||||
}
|
||||
store.dispatch( {
|
||||
type: 'FRESH_DATA_REQUESTED',
|
||||
resourceNames,
|
||||
|
|
Loading…
Reference in New Issue