peers/peerjs-server

View on GitHub
src/messageHandler/handlers/heartbeat/index.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import type { IClient } from "../../../models/client.ts";

export const HeartbeatHandler = (client: IClient | undefined): boolean => {
    if (client) {
        const nowTime = new Date().getTime();
        client.setLastPing(nowTime);
    }

    return true;
};