Skip to content

Commit cc4c8bd

Browse files
committed
Merge branch '6.4' into 7.2
* 6.4: Tweaks Update mercure.rst
2 parents f82e32b + 4a324e8 commit cc4c8bd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mercure.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ URL in a dedicated HTML element:
282282
{{ mercure('https://example.com/books/1')|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_HEX_TAG'))|raw }}
283283
</script>
284284

285+
<!-- with Stimulus -->
286+
<div {{ stimulus_controller('my-controller', {
287+
mercureUrl: mercure('https://example.com/books/1'),
288+
}) }}>
289+
285290
Then retrieve it from your JS file:
286291

287292
.. code-block:: javascript
@@ -290,6 +295,9 @@ Then retrieve it from your JS file:
290295
const eventSource = new EventSource(url);
291296
// ...
292297
298+
// with Stimulus
299+
this.eventSource = new EventSource(this.mercureUrlValue);
300+
293301
Mercure also allows subscribing to several topics,
294302
and to use URI Templates or the special value ``*`` (matched by all topics)
295303
as patterns:
@@ -704,6 +712,9 @@ enable it::
704712
:alt: The Mercure panel of the Symfony Profiler, showing information like time, memory, topics and data of each message sent by Mercure.
705713
:class: with-browser
706714

715+
The Mercure hub itself provides a debug tool that can be enabled and it's
716+
available on ``/.well-known/mercure/ui/``
717+
707718
Async dispatching
708719
-----------------
709720

0 commit comments

Comments
 (0)