Created
February 5, 2018 12:03
-
-
Save hexode/ff4118e6025b70c8070220fdc7d46a86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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