Make settings as a clean architecture
This commit is contained in:
parent
e76ca380f7
commit
bacf83a320
16 changed files with 223 additions and 196 deletions
17
src/content/client/SettingClient.ts
Normal file
17
src/content/client/SettingClient.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import Settings from '../../shared/Settings';
|
||||
import * as messages from '../../shared/messages';
|
||||
|
||||
export default interface SettingClient {
|
||||
load(): Promise<Settings>;
|
||||
|
||||
// eslint-disable-next-line semi
|
||||
}
|
||||
|
||||
export class SettingClientImpl {
|
||||
async load(): Promise<Settings> {
|
||||
let settings = await browser.runtime.sendMessage({
|
||||
type: messages.SETTINGS_QUERY,
|
||||
});
|
||||
return settings as Settings;
|
||||
}
|
||||
}
|
Reference in a new issue