aboutsummaryrefslogtreecommitdiff
path: root/src/content/repositories
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-11 19:43:56 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-18 17:28:11 +0900
commitefc48dc7421e3bd48534bc94f84e2b0bd47ae47c (patch)
treedfe80ebc368911c385e6c36aa1096af619b1616b /src/content/repositories
parenta88324acd9fe626b59637541975abe1ee6041aa7 (diff)
Keymaps as a clean architecture [WIP]
Diffstat (limited to 'src/content/repositories')
-rw-r--r--src/content/repositories/KeymapRepository.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/content/repositories/KeymapRepository.ts b/src/content/repositories/KeymapRepository.ts
new file mode 100644
index 0000000..081cc54
--- /dev/null
+++ b/src/content/repositories/KeymapRepository.ts
@@ -0,0 +1,23 @@
+import { Key } from '../../shared/utils/keys';
+
+export default interface KeymapRepository {
+ enqueueKey(key: Key): Key[];
+
+ clear(): void;
+
+ // eslint-disable-next-line semi
+}
+
+let current: Key[] = [];
+
+export class KeymapRepositoryImpl {
+
+ enqueueKey(key: Key): Key[] {
+ current.push(key);
+ return current;
+ }
+
+ clear(): void {
+ current = [];
+ }
+}