send(event, notification) {
    const user = notification.to;
    const notificationUpdate = new Promise((resolve, reject) => {
      this.io.sockets[user].emit(event, notification, (ack) => {
        if (ack) {
          this.notificationController
            .update(notification._id, { sent: true }) //eslint-disable-line
            .then(updatedNotification => resolve(updatedNotification))
            .catch((err) => {
              reject(err);
            });
        } else {
          resolve();
        }
      });
    });
    return notificationUpdate;
  }
/**
   * Send notification using socket
   * @param  {string} event        custom socket event
   * @param  {object} notification object representation for notification
   */
Send notification using socket
@param  {string} event        custom socket event
@param  {object} notification object representation for notification
Send notification using socket @param { string } event custom socket event @param { object } notification object representation for notification
send(event, notification) {
    const user = notification.to;
    const notificationUpdate = new Promise((resolve, reject) => {
      this.io.sockets[user].emit(event, notification, (ack) => {
        if (ack) {
          this.notificationController
            .update(notification._id, { sent: true }) 
            .then(updatedNotification => resolve(updatedNotification))
            .catch((err) => {
              reject(err);
            });
        } else {
          resolve();
        }
      });
    });
    return notificationUpdate;
  }
send ( event , notification ) { const user = notification . to ; const notificationUpdate = new Promise ( ( resolve , reject ) => { this . io . sockets [ user ] . emit ( event , notification , ( ack ) => { if ( ack ) { this . notificationController . update ( notification . _id , { sent : true } ) . then ( updatedNotification => resolve ( updatedNotification ) ) . catch ( ( err ) => { reject ( err ) ; } ) ; } else { resolve ( ) ; } } ) ; } ) ; return notificationUpdate ; }
Send notification using socket
 @param  {string} event        custom socket event
 @param  {object} notification object representation for notification
Send notification using socket @param { string } event custom socket event @param { object } notification object representation for notification
//eslint-disable-line