File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ Subscribing to updates in JavaScript from a Twig template is straightforward:
267267 <script>
268268
269269 The ``mercure() `` Twig function will generate the URL of the Mercure hub according to the configuration.
270- The URL will include the ``topic `` query parameters corresponding to to thee topics passed as first argument.
270+ The URL will include the ``topic `` query parameters corresponding to the topics passed as first argument.
271271
272272If you want to access to this URL from an external JavaScript file, generate the URL in a dedicated HTML element:
273273
@@ -291,13 +291,12 @@ as patterns:
291291
292292 <script>
293293 {# Subscribe to updates of several Book resources and to all Review resources matching the given pattern #}
294- const eventSource = new EventSource("{{ mercure(
295- [
296- 'https://example.com/books/1',
297- 'https://example.com/books/2',
298- 'https://example.com/reviews/{id}'
299- ]
300- )|escape('js') }}");
294+ const eventSource = new EventSource("{{ mercure([
295+ 'https://example.com/books/1',
296+ 'https://example.com/books/2',
297+ 'https://example.com/reviews/{id}'
298+ ])|escape('js') }}");
299+
301300 eventSource.onmessage = event => {
302301 console.log(JSON.parse(event.data));
303302 }
You can’t perform that action at this time.
0 commit comments