This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/background/repositories/RepeatRepository.ts
2019-05-25 21:33:33 +09:00

22 lines
507 B
TypeScript

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);
}
}