Skip to content

Commit dc35d5d

Browse files
committed
fix: ensure stats is newable (workaround for now)
1 parent 13731ba commit dc35d5d

File tree

1 file changed

+4
-2
lines changed
  • libs/angular-three-soba/performance/src/lib/stats

1 file changed

+4
-2
lines changed

libs/angular-three-soba/performance/src/lib/stats/stats.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DOCUMENT } from '@angular/common';
22
import { Directive, inject, Input, OnInit } from '@angular/core';
3-
import { addAfterEffect, addEffect, NgtInjectedRef, NgtRxStore, startWithUndefined } from 'angular-three';
3+
import { addAfterEffect, addEffect, NgtAnyRecord, NgtInjectedRef, NgtRxStore, startWithUndefined } from 'angular-three';
44
import { combineLatest } from 'rxjs';
55
import * as Stats from 'stats.js';
66

@@ -10,7 +10,9 @@ import * as Stats from 'stats.js';
1010
})
1111
export class NgtsStats extends NgtRxStore implements OnInit {
1212
private readonly document = inject(DOCUMENT);
13-
private readonly stats = new Stats();
13+
private readonly stats = (Stats as NgtAnyRecord)['default']
14+
? new (Stats as NgtAnyRecord)['default']()
15+
: new Stats();
1416

1517
@Input() set showPanel(showPanel: number) {
1618
this.set({ showPanel: showPanel === undefined ? this.get('showPanel') : showPanel });

0 commit comments

Comments
 (0)