Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda