@folklore/ads 0.0.87 → 0.0.88

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/dist/cjs.js CHANGED
@@ -954,12 +954,17 @@ function useAd(path, size) {
954
954
  // Render ad when visible
955
955
  React.useEffect(() => {
956
956
  const slotReady = slot !== null && !slot.isDefined();
957
- if (adsReady && slotReady && (alwaysRender || isVisible)) {
957
+ if (adsReady && slotReady) {
958
958
  adsManager.defineSlot(slot);
959
+ }
960
+ }, [adsManager, adsReady, slot]);
961
+ React.useEffect(() => {
962
+ const slotReady = slot !== null && !slot.isDefined();
963
+ if (adsReady && slotReady && (alwaysRender || isVisible)) {
959
964
  adsManager.displaySlot(slot);
960
965
  track('Init', slot);
961
966
  }
962
- }, [adsManager, adsReady, slot, alwaysRender, isIntersecting, track]);
967
+ }, [adsManager, adsReady, slot, alwaysRender, isVisible, track]);
963
968
 
964
969
  // Refresh ads slot
965
970
  React.useEffect(() => {
package/dist/es.js CHANGED
@@ -952,12 +952,17 @@ function useAd(path, size) {
952
952
  // Render ad when visible
953
953
  useEffect(() => {
954
954
  const slotReady = slot !== null && !slot.isDefined();
955
- if (adsReady && slotReady && (alwaysRender || isVisible)) {
955
+ if (adsReady && slotReady) {
956
956
  adsManager.defineSlot(slot);
957
+ }
958
+ }, [adsManager, adsReady, slot]);
959
+ useEffect(() => {
960
+ const slotReady = slot !== null && !slot.isDefined();
961
+ if (adsReady && slotReady && (alwaysRender || isVisible)) {
957
962
  adsManager.displaySlot(slot);
958
963
  track('Init', slot);
959
964
  }
960
- }, [adsManager, adsReady, slot, alwaysRender, isIntersecting, track]);
965
+ }, [adsManager, adsReady, slot, alwaysRender, isVisible, track]);
961
966
 
962
967
  // Refresh ads slot
963
968
  useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@folklore/ads",
3
- "version": "0.0.87",
3
+ "version": "0.0.88",
4
4
  "description": "Ads library",
5
5
  "keywords": [
6
6
  "javascript",
@@ -50,7 +50,7 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "2be118fd0754063ca851b6d769bdc6da7e495c58",
53
+ "gitHead": "fa893ed41d00c669cfab5c7780b25dc6a4f6ecf8",
54
54
  "dependencies": {
55
55
  "@folklore/hooks": "^0.0.71",
56
56
  "@folklore/tracking": "^0.0.26",