array
This commit is contained in:
parent
e2c8374431
commit
7b695c87c7
1 changed files with 4 additions and 2 deletions
6
index.js
6
index.js
|
@ -25,10 +25,12 @@ io.on('connection', (socket) => {
|
|||
}
|
||||
}
|
||||
|
||||
socket.on('setFunctions', (...args) => {
|
||||
socket.on('setFunctions', (jsonArray) => {
|
||||
const parsed = JSON.parse(jsonArray)
|
||||
|
||||
functions = {}
|
||||
|
||||
for (const eachFuntion of args) {
|
||||
for (const eachFuntion of parsed) {
|
||||
functions[eachFuntion] = (...args) => socket.emit(BRIDGE_PREFIX + eachFuntion, ...args)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue