aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-07-22 00:01:24 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-07-22 00:34:22 +0900
commita1e5e97200bd96ba918744dfa2758f977ca823c6 (patch)
treef71f0441b92ba892ad538c40d98b8477295c221d /src/background/repositories
parent89c28d67fd7b961833b557da904bd17aa28660c5 (diff)
Find as clean architecture
Diffstat (limited to 'src/background/repositories')
-rw-r--r--src/background/repositories/find.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/background/repositories/find.js b/src/background/repositories/find.js
new file mode 100644
index 0000000..9482e78
--- /dev/null
+++ b/src/background/repositories/find.js
@@ -0,0 +1,18 @@
+import MemoryStorage from '../infrastructures/memory-storage';
+
+const FIND_KEYWORD_KEY = 'find-keyword';
+
+export default class FindRepository {
+ constructor() {
+ this.cache = new MemoryStorage();
+ }
+
+ getKeyword() {
+ return Promise.resolve(this.cache.get(FIND_KEYWORD_KEY));
+ }
+
+ setKeyword(keyword) {
+ return this.cache.set(FIND_KEYWORD_KEY, keyword);
+ }
+}
+