redis
redis copied to clipboard
Redis subscribe function takes two args only
Package version
9.1
Describe the bug
I get the following error in my code while am following the documentation.
With IORedis
redis.on('message', (channel, messages) => {
console.log(message)
})
redis.subscribe('user:add', (error, count) => {
if (error) {
console.log(error)
}
})
With AdonisJS
redis.subscribe('user:add', (message) => {
console.log(message)
},
{
onError(error) {
console.log(error)
},
onSubscription(count) {
console.log(count)
},
})
Expected 2 arguments, but got 3.ts(2554)
redis.subscribe(`job-application:${entityId}`, (message) => {
console.log('send message:', message)
}, {
onError(error) {
console.error('Failed to subscribe:', error)
},
onSubscription(count) {
console.log(`Subscribed to ${count} channels.`)
},
})
Reproduction repo
No response
- Where does this error come from?
- Can you please share the complete error stack?
Closing since no answer from issue reporter.