podchat-browser
Version:
Javascript SDK to use POD's Chat Service - Browser Only
37 lines (35 loc) • 1.24 kB
JavaScript
import {StoreEvents} from "./eventEmitter";
import {ReactionsSummariesCache} from "./reactionsSummaries";
import {SDKUser} from "./user";
import {ReactionsListCache} from "./reactionsList";
import {ThreadsList} from "./threads";
import {historyCache} from "./history";
import {ContactsList} from "./contactsList";
import {Thread} from "./threads/thread";
import {UsersNotSeenDuration} from "./usersNotSeenDuration";
function Store(app) {
return {
threads: new ThreadsList(app),
thread: new Thread(app),
contacts: new ContactsList(app),
events: new StoreEvents(),
reactionSummaries: new ReactionsSummariesCache(app),
reactionsList: new ReactionsListCache(app),
user: new SDKUser(app),
threadCallbacks: {},
sendMessageCallbacks: {},
messagesCallbacks: {},
asyncRequestTimeouts: {},
history: historyCache,
httpRequestObject: {},
resumableRequestsObject: {},
chatSendQueue: [],
notSeenDuration: new UsersNotSeenDuration(app),
asyncInfo: {
deviceId: undefined,
peerId: undefined,
oldPeerId: undefined
}
}
}
export {Store}