utils/active.user.js
function init() {
        return user.initComplete ?
            Q.when(user) :
            userService.findMe()
                .then(function setUserLocal(me) {
                    me = me || {};

                    // pull out the user
                    _.extend(user, me.user);

                    // return the user and notify init complete
                    user.initComplete = true;
                    eventBus.emit('user.init');

                    return user;
                });
    }
function init() {
        return user.initComplete ?
            Q.when(user) :
            userService.findMe()
                .then(function setUserLocal(me) {
                    me = me || {};

                    // pull out the user
                    _.extend(user, me.user);

                    // return the user and notify init complete
                    user.initComplete = true;
                    eventBus.emit('user.init');

                    return user;
                });
    }
function init ( ) { return user . initComplete ? Q . when ( user ) : userService . findMe ( ) . then ( function setUserLocal ( me ) { me = me || { } ; // pull out the user _ . extend ( user , me . user ) ; // return the user and notify init complete user . initComplete = true ; eventBus . emit ( 'user.init' ) ; return user ; } ) ; }
If user already loaded, use that, otherwise get it from the API
@returns {*}
If user already loaded use that otherwise get it from the API