In the past couple of days, I developed a library that makes using Yjs incredibly simple in straightforward scenarios.
If you’re interested, feel free to take a look and follow the project!
In the past couple of days, I developed a library that makes using Yjs incredibly simple in straightforward scenarios.
If you’re interested, feel free to take a look and follow the project!
Sweeeet! Thanks for sharing
Feel free to open a PR to add rhine-var to the Yjs readme!
Congrats on bringing a new wrapper for YJS to life.
Are rhineProxy()
and useRhine()
the entire API? Are their more doc’s coming or more aren’t needed.
Finally is the “Rihine Var Playground” online for us to play with?
Sorry for the late reply, I’ve been quite busy with work lately.
Thank you so much for your recognition! I plan to improve the API documentation in the near future and add some code examples and an online demo. Once that’s done, I’ll submit a PR. I really appreciate your support for the project!
Thanks for the interest.
rhineProxy()
is just the API for the simplest use cases. There are many more APIs supported, and the object returned by rhineProxy()
is of the RhineVar
type.
Here’s a simple example of the functionality within RhineVar
. It can use .native
to access the Y.Map object it manages, and with .json()
, it converts the Yjs data into a basic JavaScript object. It also supports event listeners like subscribe
, subscribeKey
, and subscribeDeep
(currently in development). If it manages a Y.Array
, I’ve also created a wrapper that allows you to manipulate the RhineVar
object using the exact same API as you would with a regular JavaScript array, indirectly controlling the Y.Array
. More features are still in development.
As for useRhine
, it’s only meant to be used in React environments when displaying the RhineVar
content on the page. It’s similar to the YJS Hook mentioned in another thread.
I’ll be writing a more detailed Markdown documentation soon and posting it on GitHub. Additionally, more examples will be available on CodeSandbox, along with an online demo.