Skip to content

Commit

Permalink
do an environment test for nodejs - fixes #166
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Jan 17, 2024
1 parent ff51189 commit 635f39d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/y-websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import * as awarenessProtocol from 'y-protocols/awareness'
import { Observable } from 'lib0/observable'
import * as math from 'lib0/math'
import * as url from 'lib0/url'
import * as env from 'lib0/environment'

export const messageSync = 0
export const messageQueryAwareness = 3
Expand Down Expand Up @@ -357,7 +358,7 @@ export class WebsocketProvider extends Observable {
'app closed'
)
}
if (typeof process !== 'undefined') {
if (env.isNode && typeof process !== 'undefined') {
process.on('exit', this._exitHandler)
}
awareness.on('update', this._awarenessUpdateHandler)
Expand Down

0 comments on commit 635f39d

Please sign in to comment.