aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ChatBox/ChunkManager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/ChatBox/ChunkManager.ts')
-rw-r--r--src/client/views/nodes/ChatBox/ChunkManager.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client/views/nodes/ChatBox/ChunkManager.ts b/src/client/views/nodes/ChatBox/ChunkManager.ts
new file mode 100644
index 000000000..64c073640
--- /dev/null
+++ b/src/client/views/nodes/ChatBox/ChunkManager.ts
@@ -0,0 +1,24 @@
+import { SimplifiedChunk } from './types';
+
+class ChunkManager {
+ private chunks: SimplifiedChunk[];
+
+ constructor() {
+ this.chunks = [];
+ }
+
+ addChunk(chunk: SimplifiedChunk) {
+ this.chunks.push(chunk);
+ }
+
+ removeChunk(chunk: SimplifiedChunk) {
+ const index = this.chunks.indexOf(chunk);
+ if (index !== -1) {
+ this.chunks.splice(index, 1);
+ }
+ }
+
+ getChunks() {
+ return this.chunks;
+ }
+}