From 58be1809c46cbe517a18d86d0af52179dcc5cbf6 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 29 Jun 2025 17:31:30 -0700 Subject: Move to nodejs and also lots of significant refactoring that should've been broken up but idgaf --- u/history.ts | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 u/history.ts (limited to 'u/history.ts') diff --git a/u/history.ts b/u/history.ts deleted file mode 100644 index 5b13961..0000000 --- a/u/history.ts +++ /dev/null @@ -1,36 +0,0 @@ -export interface History { - undo: () => History | undefined; - redo: () => History | undefined; - - get: () => T; - add: (value: T) => History; -} - -export class HistoryImpl implements History { - private readonly item: T; - private previous?: History; - private next?: History; - - constructor(item: T) { - this.item = item; - } - - public get(): T { - return this.item; - } - - public undo(): History | undefined { - return this.previous; - } - - public redo(): History | undefined { - return this.next; - } - - public add(value: T): History { - const newHistory = new HistoryImpl(value); - newHistory.previous = this; - this.next = newHistory; - return newHistory; - } -} -- cgit v1.2.3-70-g09d2