Re-jig config accessors
We only ever used the static instance() method to get to the config object, so just make a static instance that returns the ConfigOptions directly, throwing an exception if it's not yet initialised. This way the types can all be non-optional (plus it's shorter).
This commit is contained in:
parent
6303b357ab
commit
c879090a34
4 changed files with 19 additions and 20 deletions
|
|
@ -114,8 +114,8 @@ export class PosthogAnalytics {
|
|||
|
||||
constructor(private readonly posthog: PostHog) {
|
||||
const posthogConfig: PosthogSettings = {
|
||||
project_api_key: Config.instance.config.posthog?.api_key,
|
||||
api_host: Config.instance.config.posthog?.api_host,
|
||||
project_api_key: Config.get().posthog?.api_key,
|
||||
api_host: Config.get().posthog?.api_host,
|
||||
};
|
||||
|
||||
if (posthogConfig.project_api_key && posthogConfig.api_host) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue