Skip to content

Commit

Permalink
Breaking: remove ready alias of open event (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Jan 27, 2024
1 parent 1e08b30 commit 5f7b923
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
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 @@ -992,10 +991,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
Original file line number Diff line number Diff line change
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

0 comments on commit 5f7b923

Please sign in to comment.