function render(req, res, next)  {
    if (!req.session[sessionName].length) {
      next();
    } else {
      const resultHTML = [];
      async.each(
        req.session[sessionName],
        function(item, next) {
          beforeSingleRender(item, function(error, item) {
            if (error) return next(error);
            app.render(viewName, item, function(error, html) {
              if (error) return next(error);
              resultHTML.push(html);
              next(null);
            })
          })
        },
        function(error) {
          if (error) return next(error);
          req.session[sessionName].length = 0;
          afterAllRender(resultHTML, function(error, html) {
            if (error) return next(error);
            res.locals[localsName] = html;
            next();
          })
        }
      )
    }
  }
function render(req, res, next)  {
    if (!req.session[sessionName].length) {
      next();
    } else {
      const resultHTML = [];
      async.each(
        req.session[sessionName],
        function(item, next) {
          beforeSingleRender(item, function(error, item) {
            if (error) return next(error);
            app.render(viewName, item, function(error, html) {
              if (error) return next(error);
              resultHTML.push(html);
              next(null);
            })
          })
        },
        function(error) {
          if (error) return next(error);
          req.session[sessionName].length = 0;
          afterAllRender(resultHTML, function(error, html) {
            if (error) return next(error);
            res.locals[localsName] = html;
            next();
          })
        }
      )
    }
  }
function render ( req , res , next ) { if ( ! req . session [ sessionName ] . length ) { next ( ) ; } else { const resultHTML = [ ] ; async . each ( req . session [ sessionName ] , function ( item , next ) { beforeSingleRender ( item , function ( error , item ) { if ( error ) return next ( error ) ; app . render ( viewName , item , function ( error , html ) { if ( error ) return next ( error ) ; resultHTML . push ( html ) ; next ( null ) ; } ) } ) } , function ( error ) { if ( error ) return next ( error ) ; req . session [ sessionName ] . length = 0 ; afterAllRender ( resultHTML , function ( error , html ) { if ( error ) return next ( error ) ; res . locals [ localsName ] = html ; next ( ) ; } ) } ) } }
Render notifications in queue.
@private
Render notifications in queue .