summaryrefslogtreecommitdiff
path: root/u/history.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-06-29 17:31:30 -0700
committerElizabeth Hunt <me@liz.coffee>2025-06-29 17:31:30 -0700
commit58be1809c46cbe517a18d86d0af52179dcc5cbf6 (patch)
tree9ccc678b3fd48c1a52fe501600dd2c2051740a55 /u/history.ts
parentd4791f3d357634daf506fb8f91cc5332a794c421 (diff)
downloadci-58be1809c46cbe517a18d86d0af52179dcc5cbf6.tar.gz
ci-58be1809c46cbe517a18d86d0af52179dcc5cbf6.zip
Move to nodejs and also lots of significant refactoring that should've been broken up but idgaf
Diffstat (limited to 'u/history.ts')
-rw-r--r--u/history.ts36
1 files changed, 0 insertions, 36 deletions
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<T> {
- undo: () => History<T> | undefined;
- redo: () => History<T> | undefined;
-
- get: () => T;
- add: (value: T) => History<T>;
-}
-
-export class HistoryImpl<T> implements History<T> {
- private readonly item: T;
- private previous?: History<T>;
- private next?: History<T>;
-
- constructor(item: T) {
- this.item = item;
- }
-
- public get(): T {
- return this.item;
- }
-
- public undo(): History<T> | undefined {
- return this.previous;
- }
-
- public redo(): History<T> | undefined {
- return this.next;
- }
-
- public add(value: T): History<T> {
- const newHistory = new HistoryImpl(value);
- newHistory.previous = this;
- this.next = newHistory;
- return newHistory;
- }
-}