mirror of
https://github.com/Rolands-Laucis/Socio.git
synced 2026-05-15 14:15:57 -06:00
comments
This commit is contained in:
parent
e96de9ecdb
commit
0ca098136d
2 changed files with 2 additions and 1 deletions
|
|
@ -88,7 +88,7 @@ export class SocioClient {
|
|||
|
||||
ready(){return new Promise(res => this.#is_ready = res)}
|
||||
|
||||
//private method
|
||||
//private method - accepts infinite arguments of data to send and will append these params as new key:val pairs to the parent object
|
||||
#send(kind='', ...data){ //data is an array of parameters to this func, where every element (after first) is an object. First param can also not be an object in some cases
|
||||
if(data.length < 1) soft_error('Not enough arguments to send data! kind;data:', kind, ...data) //the first argument must always be the data to send. Other params may be objects with aditional keys to be added in the future
|
||||
this.#ws.send(JSON.stringify(Object.assign({}, { client_id: this.#ses_id, kind: kind, data:data[0] }, ...data.slice(1))))
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ class Session{
|
|||
// log('reg hook', table, this.#hooks[table])
|
||||
}
|
||||
|
||||
//accepts infinite arguments of data to send and will append these params as new key:val pairs to the parent object
|
||||
Send(kind = '', ...data) {//data is an array of parameters to this func, where every element (after first) is an object. First param can also not be an object in some cases
|
||||
if (data.length < 1) soft_error('Not enough arguments to send data! kind;data:', kind, ...data) //the first argument must always be the data to send. Other params may be objects with aditional keys to be added in the future
|
||||
this.#ws.send(JSON.stringify(Object.assign({}, { kind: kind, data: data[0] }, ...data.slice(1))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue