aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories/setting.js
blob: d9c481dadc08ba80472b370577c402b381803ea1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import MemoryStorage from '../infrastructures/memory-storage';

const CACHED_SETTING_KEY = 'setting';

export default class SettingRepository {
  constructor() {
    this.cache = new MemoryStorage();
  }

  get() {
    return Promise.resolve(this.cache.get(CACHED_SETTING_KEY));
  }

  update(value) {
    return this.cache.set(CACHED_SETTING_KEY, value);
  }
}