Files
speckle-server/packages/server/modules/comments/index.ts
T
Chuck Driesler 79d4e2d402 chore(comments): update comments module to typescript (#2513)
* 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
2024-08-21 13:03:02 +01:00

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