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

feat: Redis#connect() will be resolved when status is ready #648

Merged
merged 2 commits into from
Jun 30, 2018

Conversation

luin
Copy link
Collaborator

@luin luin commented Jun 29, 2018

BREAKING CHANGE:
Redis#connect() will be resolved when status is ready
instead of connect:

const redis = new Redis({ lazyConnect: true })
redis.connect().then(() => {
  assert(redis.status === 'ready')
})

BREAKING CHANGE:
`Redis#connect()` will be resolved when status is ready
instead of `connect`:

```
const redis = new Redis({ lazyConnect: true })
redis.connect().then(() => {
  assert(redis.status === 'ready')
})
```
lib/redis.js Outdated
@@ -305,10 +311,10 @@ Redis.prototype.connect = function (callback) {
resolve();
};
var connectionCloseHandler = function () {
_this.removeListener(CONNECT_EVENT, connectionConnectHandler);
_this.removeListener('ready', connectionConnectHandler);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename connectionConnectHandler to connectionReadyHandler

@luin luin merged commit f0c600b into v4 Jun 30, 2018
@luin luin deleted the v4-redis-connect-ready branch June 30, 2018 03:29
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

Successfully merging this pull request may close these issues.

2 participants