INNER CODE UNIT · TypeScript

addSyncPoint

NSSTC/sim-ecs · src/ecs/ecs-sync-point.ts:9

export function addSyncPoint(syncPoint: Readonly<ISyncPoint>): void {
    if (!syncPoint.name) {
        throw new Error('Cannot register a sync point without a name!');
    }

    {
        const name = syncPoint.name;

        if (syncPoints.has(name) && syncPoints.get(name) != syncPoint) {
            throw new Error(`Another sync point with the name "${name}" has already been registered!`);
        }

        syncPoints.set(name, syncPoint);
    }
}

/**
 * Find a sync-point by name, if it exists

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…