Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoomObject.receive RoomObject.receipt 应采用事件模型而非方法 #129

Closed
leeyeh opened this issue Jul 9, 2015 · 2 comments
Closed

Comments

@leeyeh
Copy link
Contributor

leeyeh commented Jul 9, 2015

这两个方法容易产生误解,考虑 RoomObject 是否也应该有个事件机制:room.on('message', callback); 或者至少方法名不要用主动动词:room.onMessage(callback)

@wangxiao
Copy link
Contributor

wangxiao commented Jul 9, 2015

当时设计时考虑 roomObject 中不要暴露底层事件,不希望用户产生混乱。
receive 和 receipt 相当于是快捷方法。
你可以理解为 jQuery 中的 click、dblclick 等方法一个道理。

@wangxiao
Copy link
Contributor

已经讨论。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants