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

Breaking: remove ready alias of open event #48

Merged
merged 1 commit into from Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions README.md
Expand Up @@ -90,7 +90,6 @@
- [Events](#events)
- [`opening`](#opening)
- [`open`](#open)
- [`ready` (deprecated)](#ready-deprecated)
- [`closing`](#closing)
- [`closed`](#closed)
- [`write`](#write)
Expand Down Expand Up @@ -993,10 +992,6 @@ db.once('open', function () {
})
```

#### `ready` (deprecated)

Alias for the `open` event. Deprecated in favor of the `open` event.

#### `closing`

Emitted when database is closing. Receives 0 arguments.
Expand Down
6 changes: 1 addition & 5 deletions abstract-level.js
Expand Up @@ -92,8 +92,7 @@ class AbstractLevel extends EventEmitter {
{ name: 'write' },
{ name: 'put', deprecated: true, alt: 'write' },
{ name: 'del', deprecated: true, alt: 'write' },
{ name: 'batch', deprecated: true, alt: 'write' },
{ name: 'ready', deprecated: true, alt: 'open' }
{ name: 'batch', deprecated: true, alt: 'write' }
])

this[kTranscoder] = new Transcoder(formats(this))
Expand Down Expand Up @@ -236,9 +235,6 @@ class AbstractLevel extends EventEmitter {
// Only emit public event if pending state changes are done
if (this[kStatus] === 'open') this.emit('open')

// TODO (next major): remove this alias
if (this[kStatus] === 'open') this.emit('ready')

maybeOpened()
}
} else if (this[kStatus] === 'open') {
Expand Down