Skip to content

Commit 5db1f7c

Browse files
committed
fix default options
1 parent 41ff438 commit 5db1f7c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ function getServerIpAddress(host, port) {
2727
return `localhost:${port}`
2828
}
2929

30-
module.exports = function install(Vue, options = {debug: false, host: null, port: 8098}) {
30+
module.exports = function install(Vue, {debug = false, host = null, port = 8098} = {}) {
3131
const startApp = Vue.prototype.$start
3232

3333
Vue.prototype.$start = function () {
34-
devtools.connect('ws://localhost', options.port, {
34+
devtools.connect('ws://localhost', port, {
3535
app: this,
3636
showToast: (message) => require('nativescript-toast').makeText(message).show(),
3737
io() {
38-
const addr = `http://${getServerIpAddress(options.host, options.port)}`
38+
const address = `http://${getServerIpAddress(host, port)}`
3939
const SocketIO = require('nativescript-socket.io')
40-
options.debug && SocketIO.enableDebug()
40+
debug && SocketIO.enableDebug()
4141

42-
return SocketIO.connect(addr)
42+
return SocketIO.connect(address)
4343
}
4444
})
4545

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)