aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories/FindRepository.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/repositories/FindRepository.ts')
-rw-r--r--src/background/repositories/FindRepository.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/background/repositories/FindRepository.ts b/src/background/repositories/FindRepository.ts
new file mode 100644
index 0000000..bf286e6
--- /dev/null
+++ b/src/background/repositories/FindRepository.ts
@@ -0,0 +1,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();
+ }
+}
+