Code Monkey home page Code Monkey logo

Comments (4)

markandrus avatar markandrus commented on August 9, 2024

Hi @treyrich, thanks for the report. We did recently refactor the internals to be more strictly follow state transitions. I think there are two things we could do here

  1. Be more lenient in Conversation's disconnect method—i.e. is it really useful to throw if disconnect is called twice?
  2. Expose the Conversation state, either an isConnected or some other state property.

from twilio-video.js.

treyrich avatar treyrich commented on August 9, 2024

Right. I think either would work. I mean honestly I was able to refactor my code to cover most cases pretty well. But it's just nice if in your teardown code you're able to just call conversation.disconnect() without having to worry about it potentially throwing an error if it was previously disconnected. It can certainly be handled by the developer, but it seems like since the library is already storing the state that it's redundant for the developer to do so also.

Personally I think that it will promote better, more well thought out, code to go with option 2 and expose the conversation state in some way, and continue the strict checking.

from twilio-video.js.

markandrus avatar markandrus commented on August 9, 2024

That is good feedback, @treyrich—thank you. I will share it with the team.

from twilio-video.js.

markandrus avatar markandrus commented on August 9, 2024

Hi @treyrich,

We've recently made a number of changes to the Video SDK: it's now called twilio-video.js instead of twilio-conversations.js; we've also simplified the object model (no more invites, Conversations are replaced by "Rooms", etc.).

The full API docs can be found here, but importantly we've

  • Added a state property to the Room (which is either "connected" or "disconnected"), and
  • Multiple disconnects no longer throw.

Hopefully this improves over the Conversations behavior.

Best,
Mark

from twilio-video.js.

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.