is possible to implement use Server-Sent Events in blazor apps? Or there is other method to listening for request/response to API?
<script>
source = new EventSource('/Home/Messaggio');
source.onopen = function (ddd) {
console.log("aperta");
};
source.onerror = function (ddd) {
console.log("errore");
console.log(ddd.data);
source.close();
};
source.onmessage = function (ddd) {
$("#Messaggio").text(ddd.data);
console.log(ddd.data);
};
</script>
Is method to get data in javascript code and add the data to C# blazor variable List responseObject?