Skip to content

Commit bdc5577

Browse files
Merge pull request #2 from splatEric/master
support for whisper method on private channels
2 parents 623bd50 + 8b9be7a commit bdc5577

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,21 @@ wrapper.vm.$nextTick(() => {
133133

134134
## Client events
135135

136-
You can use `userWhisper` to send user event. Only private channel object and presence channel object have `userWhisper`.
136+
You can use `whisper` to send user event. Only private channel object and presence channel object have `whisper`.
137137

138138
> Note: If you are using `vue-test-utils`, call `$nextTick` before assertion.
139139
140140
Example:
141141
```javascript
142142
// private channel
143-
mockEcho.getPrivateChannel('meeting').userWhisper('meetingClicking', { username: username })
143+
mockEcho.getPrivateChannel('meeting').whisper('meetingClicking', { username: username })
144144
wrapper.vm.$nextTick(() => {
145145
expect(wrapper.find('.whisper-message').text()).toBe(`${username} is clicking the button`)
146146
done()
147147
})
148148

149149
// presence channel
150-
mockEcho.getPresenceChannel('chat').userWhisper('chatClicking', { username: username })
150+
mockEcho.getPresenceChannel('chat').whisper('chatClicking', { username: username })
151151
wrapper.vm.$nextTick(() => {
152152
expect(wrapper.find('.whisper-message').text()).toBe(`${username} is clicking the button`)
153153
done()

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PrivateChannel extends Channel {
3535
this.notificationFn = null
3636
}
3737

38-
userWhisper (eventName, event) {
38+
whisper (eventName, event) {
3939
if (typeof this.clientEvents[`client-${eventName}`] === 'undefined') {
4040
console.error(`Channel didn't listen to client event: ${eventName}`)
4141
return

0 commit comments

Comments
 (0)