Keymaps as a clean architecture [WIP]

This commit is contained in:
Shin'ya Ueoka 2019-05-11 19:43:56 +09:00
parent a88324acd9
commit efc48dc742
15 changed files with 620 additions and 88 deletions

View file

@ -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 = [];
}
}