Skip to content

Commit 684ddfd

Browse files
authored
Added connection variable for manual-connect
Added the option to connect to a connection other than the connections dictated in the instantiation. Can be used as usual with `this.$connect()`, or alternatively `this.$connect('ws://localhost:port/foo/')` to specify a different socket endpoint/channel.
1 parent d77cb65 commit 684ddfd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export default {
1313
}
1414

1515
if (opts.connectManually) {
16-
Vue.prototype.$connect = () => {
16+
Vue.prototype.$connect = (connectionAlternative) => {
17+
if (connectionAlternative) {
18+
connection = connectionAlternative
19+
}
1720
observer = new Observer(connection, opts)
1821
Vue.prototype.$socket = observer.WebSocket
1922
}

0 commit comments

Comments
 (0)