Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
RxJS Socket.IO Angular Chat - Angular Component - Coding Blast -
ngOnInit() {
.filter((message) => message.trim().length > 0)
.scan((acc: string, message: string, index: number) =>
`${message}(${index + 1})`
, 1)
.subscribe((message: string) => {
const currentTime = moment().format('hh:mm:ss a');
const messageWithTimestamp = `${currentTime}: ${message}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.