Interceptors
μΌλ° μΈν°μ ν°μ λ§μ΄ν¬λ‘ μλΉμ€ μΈν°μ ν° μ¬μ΄μλ μ°¨μ΄κ° μμ΅λλ€. λ€μμ μλμΌλ‘ μΈμ€ν΄μ€νλ λ©μλ λ²μ μΈν°μ ν°λ₯Ό μ¬μ©νλ μμ μ λλ€ (ν΄λμ€ λ²μλ μλ ν¨).
@@filename()
@UseInterceptors(new TransformInterceptor())
@MessagePattern({ cmd: 'sum' })
accumulate(data: number[]): number {
return (data || []).reduce((a, b) => a + b);
}
Last updated
Was this helpful?