diff options
Diffstat (limited to 'src/background/repositories/RepeatRepository.ts')
-rw-r--r-- | src/background/repositories/RepeatRepository.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/background/repositories/RepeatRepository.ts b/src/background/repositories/RepeatRepository.ts new file mode 100644 index 0000000..c7f7a71 --- /dev/null +++ b/src/background/repositories/RepeatRepository.ts @@ -0,0 +1,22 @@ +import { injectable } from 'tsyringe'; +import { Operation } from '../../shared/operations'; +import MemoryStorage from '../infrastructures/MemoryStorage'; + +const REPEAT_KEY = 'repeat'; + +@injectable() +export default class RepeatRepository { + private cache: MemoryStorage; + + constructor() { + this.cache = new MemoryStorage(); + } + + getLastOperation(): Operation | undefined { + return this.cache.get(REPEAT_KEY); + } + + setLastOperation(op: Operation): void { + this.cache.set(REPEAT_KEY, op); + } +} |