Wed Jan 27 2021 05:14:06 GMT+0000 (Coordinated Universal Time)
Saved by @delitescere #kotlin,springframework
<turbo-stream action="replace" target="load" data-th-each="load : ${loadStream}"> <template> <span id="load">[[${load.at}]]: [[${load.avg}]]</span> </template> </turbo-stream>
#kotlin,springframework
@GetMapping(produces = [MediaType.TEXT_EVENT_STREAM_VALUE]) suspend fun load(model: Model): String { model.addAttribute("loadStream", dataDrivenEach(loadService.stream())) return "load.turbo-stream" }
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments