I’ve made a bunch of modifications. The front end is a little messy because I am trying to keep it simple by just depending jquery rather than angular or react or something.
The current implementation demonstrates subscribing to a list of (basket) models in addition to subscribing to a given (basket) model.
One of the issues that I’m still wrestling with is the separation of the initial result with the flux of incremental updates. I feel like there should be a way to subscribe and get the both the initial state back plus the incremental updates. As it it now I must subscribe to the updates and then go get the current state an integrate it all on the client.
Also, why does the client need to fetch the initial result in a separate request? You could simply send the initial result as the first SSE, and the updates following that.
As an example of how to combine ‘initialResult’ and ‘incrementalUpdates’ you can take a look at this small example I built to demonstrate usage of subscription queries.