Use readonly shorthand for posthog param

pull/21833/head
James Salter 2021-07-28 14:38:41 +01:00
parent 60bc283455
commit a687bab52f
1 changed files with 1 additions and 3 deletions

View File

@ -138,7 +138,6 @@ export class PosthogAnalytics {
*/
private anonymity = Anonymity.Anonymous;
private posthog?: PostHog = null;
// set true during the constructor if posthog config is present, otherwise false
private enabled = false;
private static _instance = null;
@ -151,8 +150,7 @@ export class PosthogAnalytics {
return this._instance;
}
constructor(posthog: PostHog) {
this.posthog = posthog;
constructor(private readonly posthog: PostHog) {
const posthogConfig = SdkConfig.get()["posthog"];
if (posthogConfig) {
this.posthog.init(posthogConfig.projectApiKey, {