This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/content/usecases/SettingUseCase.ts
2019-05-11 08:04:01 +09:00

24 lines
655 B
TypeScript

import SettingRepository, { SettingRepositoryImpl }
from '../repositories/SettingRepository';
import SettingClient, { SettingClientImpl } from '../client/SettingClient';
import Settings from '../../shared/Settings';
export default class SettingUseCase {
private repository: SettingRepository;
private client: SettingClient;
constructor({
repository = new SettingRepositoryImpl(),
client = new SettingClientImpl(),
} = {}) {
this.repository = repository;
this.client = client;
}
async reload(): Promise<Settings> {
let settings = await this.client.load();
this.repository.set(settings);
return settings;
}
}