You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would this be required to use it with ShareDB on the server?
Trying to understand how this fits in with WebSocketJSONStream. Client API makes sense but I don't get how to put a pipe in front of ShareDB on the server.
For future readers (if the interface hasn't been fixed in the library), to work with ShareDB on the server, the following did the trick for me:
import{Pipe}from'hydrated-ws'// the sole purpose of this is to patch the interfaceclassEmitterPipeextendsPipe{on(event,cb){returnthis.addEventListener(event,(msg)=>cb(msg.data));}}constwss=newWebSocket.Server();wss.on('connection',(ws)=>{constShareDBChannel=newEmitterPipe(ws,'SDB');conststream=newWebSocketJSONStream(ShareDBChannel);this.share.listen(stream);});
When the fix for #101 lands, sounds like the patch class won't be necessary and when bottling lands, the WebSocketJSONStream won't be necessary either.
AKA json-streaming with filter
The text was updated successfully, but these errors were encountered: