Skip to content

Commit 4ee4411

Browse files
committed
Don't subscribe to Mercure when the list is empty
1 parent 1a02528 commit 4ee4411

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

templates/react-common/actions/foo/list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function list(page = '{{{name}}}') {
3535
dispatch(loading(false));
3636
dispatch(success(retrieved));
3737

38-
if (hubURL)
38+
if (hubURL && retrieved['hydra:member'].length)
3939
dispatch(
4040
mercureSubscribe(
4141
hubURL,

yarn.lock

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,9 +1639,9 @@ copy-descriptor@^0.1.0:
16391639
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=
16401640

16411641
core-js@^2.4.0, core-js@^2.5.0:
1642-
version "2.6.1"
1643-
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.1.tgz#87416ae817de957a3f249b3b5ca475d4aaed6042"
1644-
integrity sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg==
1642+
version "2.6.2"
1643+
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.2.tgz#267988d7268323b349e20b4588211655f0e83944"
1644+
integrity sha512-NdBPF/RVwPW6jr0NCILuyN9RiqLo2b1mddWHkUL+VnvcB7dzlnBJ1bXYntjpTGOgkZiiLWj2JxmOr7eGE3qK6g==
16451645

16461646
core-util-is@1.0.2, core-util-is@~1.0.0:
16471647
version "1.0.2"
@@ -2481,9 +2481,9 @@ glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3:
24812481
path-is-absolute "^1.0.0"
24822482

24832483
globals@^11.1.0, globals@^11.7.0:
2484-
version "11.9.0"
2485-
resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249"
2486-
integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==
2484+
version "11.10.0"
2485+
resolved "https://registry.yarnpkg.com/globals/-/globals-11.10.0.tgz#1e09776dffda5e01816b3bb4077c8b59c24eaa50"
2486+
integrity sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==
24872487

24882488
globals@^9.18.0:
24892489
version "9.18.0"
@@ -2803,6 +2803,11 @@ invert-kv@^1.0.0:
28032803
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
28042804
integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY=
28052805

2806+
ip-regex@^3.0.0:
2807+
version "3.0.0"
2808+
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-3.0.0.tgz#0a934694b4066558c46294244a23cc33116bf732"
2809+
integrity sha512-T8wDtjy+Qf2TAPDQmBp0eGKJ8GavlWlUnamr3wRn6vvdZlKVuJXXMlSncYFRYgVHOM3If5NR1H4+OvVQU9Idvg==
2810+
28062811
is-accessor-descriptor@^0.1.6:
28072812
version "0.1.6"
28082813
resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
@@ -5218,7 +5223,16 @@ to-regex@^3.0.1, to-regex@^3.0.2:
52185223
regex-not "^1.0.2"
52195224
safe-regex "^1.1.0"
52205225

5221-
tough-cookie@>=2.3.3, tough-cookie@^2.3.4:
5226+
tough-cookie@>=2.3.3:
5227+
version "3.0.0"
5228+
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.0.tgz#d2bceddebde633153ff20a52fa844a0dc71dacef"
5229+
integrity sha512-LHMvg+RBP/mAVNqVbOX8t+iJ+tqhBA/t49DuI7+IDAWHrASnesqSu1vWbKB7UrE2yk+HMFUBMadRGMkB4VCfog==
5230+
dependencies:
5231+
ip-regex "^3.0.0"
5232+
psl "^1.1.28"
5233+
punycode "^2.1.1"
5234+
5235+
tough-cookie@^2.3.4:
52225236
version "2.5.0"
52235237
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
52245238
integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==

0 commit comments

Comments
 (0)