A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
655 B
25 lines
655 B
5 years ago
|
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;
|
||
|
}
|
||
|
}
|