@mjhls/mjh-framework 1.0.691-beta.1 → 1.0.691-beta.2

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.
@@ -17,16 +17,20 @@ var AdSlotsProvider = function AdSlotsProvider(_ref) {
17
17
  singleRequest = _ref$singleRequest === undefined ? true : _ref$singleRequest;
18
18
 
19
19
  React.useEffect(function () {
20
- // Refresh ADs after one minute of user not scrolled
20
+ // Refresh ADs after every one minute of user not scrolled
21
21
  var isScrolling = void 0;
22
- window.addEventListener('scroll', function () {
23
- clearTimeout(isScrolling);
24
- isScrolling = setTimeout(function () {
22
+ var refreshADsAfterInterval = function refreshADsAfterInterval() {
23
+ isScrolling = setInterval(function () {
25
24
  index.lib_3.refresh();
26
- }, 10000);
25
+ }, 30000);
26
+ };
27
+ refreshADsAfterInterval();
28
+ window.addEventListener('scroll', function () {
29
+ clearInterval(isScrolling);
30
+ refreshADsAfterInterval();
27
31
  }, false);
28
32
  return function () {
29
- clearTimeout(isScrolling);
33
+ clearInterval(isScrolling);
30
34
  };
31
35
  }, []);
32
36
 
@@ -1,6 +1,6 @@
1
1
  import './_commonjsHelpers-0c4b6f40.js';
2
2
  import React__default, { useEffect } from 'react';
3
- import { l as lib_3, b as lib_1 } from './index-0e45a0b2.js';
3
+ import { b as lib_1, l as lib_3 } from './index-0e45a0b2.js';
4
4
  import 'prop-types';
5
5
 
6
6
  var AdSlotsProvider = function AdSlotsProvider(_ref) {
@@ -12,16 +12,20 @@ var AdSlotsProvider = function AdSlotsProvider(_ref) {
12
12
  singleRequest = _ref$singleRequest === undefined ? true : _ref$singleRequest;
13
13
 
14
14
  useEffect(function () {
15
- // Refresh ADs after one minute of user not scrolled
15
+ // Refresh ADs after every one minute of user not scrolled
16
16
  var isScrolling = void 0;
17
- window.addEventListener('scroll', function () {
18
- clearTimeout(isScrolling);
19
- isScrolling = setTimeout(function () {
17
+ var refreshADsAfterInterval = function refreshADsAfterInterval() {
18
+ isScrolling = setInterval(function () {
20
19
  lib_3.refresh();
21
- }, 10000);
20
+ }, 30000);
21
+ };
22
+ refreshADsAfterInterval();
23
+ window.addEventListener('scroll', function () {
24
+ clearInterval(isScrolling);
25
+ refreshADsAfterInterval();
22
26
  }, false);
23
27
  return function () {
24
- clearTimeout(isScrolling);
28
+ clearInterval(isScrolling);
25
29
  };
26
30
  }, []);
27
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.691-beta.1",
3
+ "version": "1.0.691-beta.2",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",