blob: bf286e63b1370bc5c6dc97e5e98dca0bd3132db8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import MemoryStorage from '../infrastructures/MemoryStorage';
const FIND_KEYWORD_KEY = 'find-keyword';
export default class FindRepository {
private cache: MemoryStorage;
constructor() {
this.cache = new MemoryStorage();
}
getKeyword(): Promise<string> {
return Promise.resolve(this.cache.get(FIND_KEYWORD_KEY));
}
setKeyword(keyword: string): Promise<any> {
this.cache.set(FIND_KEYWORD_KEY, keyword);
return Promise.resolve();
}
}
|