Skip to content

Instantly share code, notes, and snippets.

@hexode
Created February 5, 2018 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hexode/ff4118e6025b70c8070220fdc7d46a86 to your computer and use it in GitHub Desktop.
Save hexode/ff4118e6025b70c8070220fdc7d46a86 to your computer and use it in GitHub Desktop.
class SettingsService {
private _instance;
get() {
return this._instance
}
set(settings) {
this._instance = settings;
}
}
const settingsService = new SettingsService();
abstract class App {
constructor() {
const settings = this.getSettings();
settingsService.set(settings);
}
getSettings(): BaseSettings;
}
class BaseSettings {
}
class WorkerSettings {
}
class RequesterSettings {
}
class WorkerApp extends App {
getSettings() {
return new WorkerSettings();
}
}
class RequesterApp extends App {
getSettings() {
return new RequesterSettings();
}
}
new WorkerApp();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment