Find as clean architecture

This commit is contained in:
Shin'ya Ueoka 2018-07-22 00:01:24 +09:00
parent 89c28d67fd
commit a1e5e97200
5 changed files with 62 additions and 7 deletions

View file

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