79d4e2d402
* chore(comments): files to .ts * chore(comment): services to .ts * chore(comments): repo to .ts * chore(comments): resolvers to .ts * chore(comments): init to .ts * fix(comments): FIXME for non-null assertions * chore(comments): drop some comments
23 lines
614 B
TypeScript
23 lines
614 B
TypeScript
import { moduleLogger } from '@/logging/logging'
|
|
import { notifyUsersOnCommentEvents } from '@/modules/comments/services/notifications'
|
|
import { Optional, SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
|
|
|
let unsubFromEvents: Optional<() => void> = undefined
|
|
|
|
const commentsModule: SpeckleModule = {
|
|
async init(_, isInitial) {
|
|
moduleLogger.info('🗣 Init comments module')
|
|
|
|
if (isInitial) {
|
|
unsubFromEvents = await notifyUsersOnCommentEvents()
|
|
}
|
|
},
|
|
async finalize() {},
|
|
async shutdown() {
|
|
unsubFromEvents?.()
|
|
unsubFromEvents = undefined
|
|
}
|
|
}
|
|
|
|
export = commentsModule
|