ueberdosis / hocuspocus

The CRDT Yjs WebSocket backend for conflict-free real-time collaboration in your app.
https://tiptap.dev/docs/hocuspocus/introduction
MIT License
1.34k stars 128 forks source link

Allow token fn to return null #838

Closed fuadsaud closed 4 months ago

fuadsaud commented 5 months ago

The token passed as a value can be null already, so the code that calls the function will continue to work as intended.

Allowing a null value makes it possible to still open a connection without a token while attempting to fetch the token in an async function.

fuadsaud commented 4 months ago

It seems that this might not work since this line doesn't deal well with a null-returning function. I'll think a bit more about the design.