Git Product home page Git Product logo

Comments (6)

lzwjava avatar lzwjava commented on July 26, 2024

@wangxiao

from js-realtime-sdk.

lzwjava avatar lzwjava commented on July 26, 2024

感觉没必要通过 room.list 来获取members,多一次请求。

from js-realtime-sdk.

lzwjava avatar lzwjava commented on July 26, 2024

后来考虑一下,可能为了 room(roomId) 的时候,不去请求members,因为members 可能很长,所以单独弄成 list 来找members。看了下源码,发现 room(roomId) 也是请求了 members 的,

                    this.query({
                        where: {
                            objectId: argument
                        }
                    }, function(data) {

                        // 如果服务器端有这个 id
                        if (data.length) {
                            convObject.id = argument;
                            convObject.name = data[0].name;
                            // 获取初始化时的属性
                            convObject.attr = data[0].attr;
                        }

                        if (callback) {
                            // 如果服务器端存在就直接返回 roomObject
                            if (data.length) {
                                callback(convObject);
                            }
                            // 如果服务器端不存在这个 room id
                            else {
                                callback(null);
                            }
                        }
                    });

所以这里的设计似乎有点奇怪。

from js-realtime-sdk.

wangxiao avatar wangxiao commented on July 26, 2024

除了 member 其他几个值都是生成这个 room 时初始化的,而 member 是可能不断变化的。所以希望用户每次能够主动获取。

from js-realtime-sdk.

lzwjava avatar lzwjava commented on July 26, 2024

单聊的 members 都是固定的。

而members 还是会频繁去获取。 room.members 的很方便使用。

所以我觉得可以提供 room.members ,也支持 list 来拉取最新的members。

from js-realtime-sdk.

wangxiao avatar wangxiao commented on July 26, 2024

还是统一些比较好。

from js-realtime-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.