Giter Club home page Giter Club logo

Comments (2)

dmonad avatar dmonad commented on June 5, 2024 3

I'm sorry that this breaks your existing codebase. However, I don't want to revert to an untyped event system.
There is a big advantage in having typed events.

The only way I see to "fix" this is to allow user-defined events that you can define on Yjs using typescript. E.g. new Y.Doc<{ error: ErrorObject => void }>()

However, I also don't want to do that. There is a good chance that I eventually want to define the "error" event in Yjs. Now, if I allowed custom events, then I would break everyone's codebase whenever I added a new event. This would lock me in, making me unable to add custom events on the data type I maintain, while allowing only users to add new event types.

I also dislike it when it's not clearly defined who owns something (e.g., is the error event fired by you or by me?).

I didn't intend for users of Yjs to fire their own events using the Yjs object. Now, with the type event system it is made clear that this is not possible.

Therefore, I see the burden on you to build your own event system - possibly by wrapping Yjs in a custom datatype. I'm sorry, this is probably not what you wanted to hear.

from yjs.

rustysys-dev avatar rustysys-dev commented on June 5, 2024 1

@dmonad no problem at all, and the direction is understandable. I mainly only pointed it out because it happened in a patch version. Otherwise I wouldn't have.

Thanks for all your hard work on this project!!

from yjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.