Coder Social home page Coder Social logo

Comments (6)

ryanbliss avatar ryanbliss commented on May 29, 2024

I think I might know what the issue here. Are you calling liveState.set(undefined), and is that when the listener isn't being called? Or have you tried setting it to other values, such as a string or object?

Knowing what values are being passed in as your initial state and set param would be super helpful, thanks!!

from live-share-sdk.

mscherotter avatar mscherotter commented on May 29, 2024

I am not calling liveState.set(undefined) . I always call liveState set with a JSON object.

from live-share-sdk.

mscherotter avatar mscherotter commented on May 29, 2024

Do all members need to call livestate.initialize()? What state parameters should I specify if I don't want visitors to update the live state?

from live-share-sdk.

mscherotter avatar mscherotter commented on May 29, 2024

I was just able to fix it by calling initialize() for the visitors as well as the host, even though I don't want to set the state for the visitors.

from live-share-sdk.

ryanbliss avatar ryanbliss commented on May 29, 2024

Hey Michael, the initial state on .initialize() is not broadcasted out and will not trigger a changed event. It is just the default state, which you could make undefined in the initializerc and when the presenter connects you can then call .set("whatever") on their client. Even if someone joins late, the initial state will not override what was there beforehand.

It's just a default value, since many use cases you don't want to have to have state start as undefined (eg countState.initialize(0)). The default state will be at that initial state until the remote state starts coming in, which will always override that default value.

from live-share-sdk.

ryanbliss avatar ryanbliss commented on May 29, 2024

And yes, for all of our DDS's, all users need to call .initialize(), since that is what starts listening for socket events.

from live-share-sdk.

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.