The basic API simply streams change objects:
ripple.on('change',(name,change)=>{})// listen for all changesripple('resource').on('change',change=>{})// listen for changes to resourceUsers should also be able to subscribe using the ES6 Observable syntax:
ripple.subscribe({ next, error, complete })ripple('resource').subscribe({ next, error, complete })forawait(changeofripple){}forawait(changeofripple('resource')){}I was thinking we could use the error handler if a stream throws, but it seems that according to this answer the observable wouldn't recover if error is called. Therefore, I don't think it should be used for application-level errors, but only when the stream is truly stopped (liked losing connection - although even that is recoverable 🤔).
The basic API simply streams change objects:
Users should also be able to subscribe using the ES6 Observable syntax:
I was thinking we could use the error handler if a stream
throws, but it seems that according to this answer the observable wouldn't recover if error is called. Therefore, I don't think it should be used for application-level errors, but only when the stream is truly stopped (liked losing connection - although even that is recoverable 🤔).