Skip to content

Commit 9fa8bf0

Browse files
feat(overmind-devtools-client): expose close method to stop websocket server
1 parent 42d00c2 commit 9fa8bf0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/node_modules/overmind-devtools-client/DevtoolBackend.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class DevtoolBackend {
2020
this.devtoolServer.on('listening', resolve)
2121
})
2222
}
23+
close() {
24+
this.devtoolServer.close()
25+
}
2326
onConnection(ws, req) {
2427
// devtools connects with ?devtools=1 in url
2528
if (req.url.indexOf('devtools') !== -1) {

packages/node_modules/overmind-devtools-vscode/src/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ export function activate(context: vscode.ExtensionContext) {
4040
storage,
4141
})
4242

43+
console.log('Firing it up!!!!')
4344
devtoolBackend
4445
.connect(port)
4546
.then(() => {
47+
console.log('Okay... moving on!')
4648
let scriptFile: vscode.Uri | string
4749

4850
// TODO consider https://github.com/microsoft/vscode/commit/fbcdb4c6a736ff38e60a7e9d0a3f1be5ccbaf3af ?
@@ -59,7 +61,7 @@ export function activate(context: vscode.ExtensionContext) {
5961
DevtoolsPanel.createOrShow(context.extensionPath) // refactor to keep local reference to panel
6062
})
6163
.catch(() => {
62-
// Handle wrong port here
64+
// HANDLE WRONG PORT HERE :-)
6365
})
6466
})
6567
)

0 commit comments

Comments
 (0)