28 lines
696 B
JavaScript
28 lines
696 B
JavaScript
(function(context,$) {
|
|
|
|
"use strict";
|
|
|
|
context.JK = context.JK || {};
|
|
context.JK.UserSession = function(app) {
|
|
var logger = context.JK.logger;
|
|
var rest = context.JK.Rest();
|
|
var userId;
|
|
var user = {};
|
|
var currentUserWatchers = $();
|
|
|
|
function initialize(currentUserId) {
|
|
userId = currentUserId;
|
|
}
|
|
|
|
// called anytime user data is fetched for the current user
|
|
function registerCurrentUser(listener) {
|
|
currentUserWatchers.add($(listener));
|
|
}
|
|
|
|
this.initialize = initialize;
|
|
this.registerCurrentUser = registerCurrentUser;
|
|
return this;
|
|
};
|
|
|
|
})(window,jQuery);
|