Skip dispatching fresh data requests when the window/tab is hidden.

This commit is contained in:
Jeff Stieler 2019-03-04 12:47:48 -07:00
parent 4e9f787b13
commit b23ae97eff
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,9 @@ function createStore( name ) {
function createDataHandlers( store ) {
return {
dataRequested: resourceNames => {
if ( document.hidden ) {
return;
}
store.dispatch( {
type: 'FRESH_DATA_REQUESTED',
resourceNames,