6 lines
289 B
TypeScript
6 lines
289 B
TypeScript
/** Last write wins. Equal timestamps: incoming wins. No server row: insert. */
|
|
export function incomingWins(serverUpdatedAt: Date | null, incomingUpdatedAt: Date): boolean {
|
|
if (serverUpdatedAt === null) return true;
|
|
return incomingUpdatedAt.getTime() >= serverUpdatedAt.getTime();
|
|
}
|