Interceptors

Interceptors

์ผ๋ฐ˜ ์ธํ„ฐ์…‰ํ„ฐ์™€ ์›น ์†Œ์ผ“ ์ธํ„ฐ์…‰ํ„ฐ ์‚ฌ์ด์—๋Š” ์ฐจ์ด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ์ˆ˜๋™์œผ๋กœ ์ธ์Šคํ„ด์Šคํ™” ๋œ ๋ฉ”์†Œ๋“œ ๋ฒ”์œ„ ์ธํ„ฐ์…‰ํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค (ํด๋ž˜์Šค ๋ฒ”์œ„๋„ ์ž‘๋™ ํ•จ).

@@filename()
@UseInterceptors(new TransformInterceptor())
@SubscribeMessage('events')
handleEvent(client: Client, data: unknown): WsResponse<unknown> {
  const event = 'events';
  return { event, data };
}

Last updated

Was this helpful?