Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

137
Visualizações
JSDOC on socket.io emit

If I have socketio function like this :

_sock.emit('app_version',appversion,(response)=>{
   console.log(response)
})

and I want to put a proper JSDOC , explaining that appversion is a string, and response is a string, how do i write it ?

currently tried some combination like @param , or @property in WebStorm, yet Webstorm still don't recognize that appversion and response type.

Kindly help

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

JSDoc works best if you type things as you declare them, which doesn't work very well if you're doing things inline (such as using an inline arrow function. Try something like this, declaring and typing your variables and functions before using them:

// Use @type to indicate the type of the next following variable
/**
 * @type {string}
 */
let appversion;

// Use @param to indicate the param type of the next following function
/**
 * @param {string} response
 */
function doThing(response) {
  console.log(response);
}

_sock.emit('app_version', appversion, doThing);
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda