I'm encountering an issue while trying to expand a service in Angular that utilizes ngrx
. The error message I'm receiving is as follows:
Argument of type 'typeof Store' is not assignable to parameter of type 'Store<AppState>'
This is the parent class snippet:
import { Store } from '@ngrx/store';
import { AppState } from '../store/file-uploader.state';
import { AbstractStorage } from '@storage';
export class FileUploaderService {
constructor(
private store: Store<AppState>,
private storage: AbstractStorage,
) { }
}
Now, moving on to the child class:
import { Store } from '@ngrx/store';
import { AppState } from '../store/file-uploader.state';
import { AbstractStorage } from '@storage';
export class DataSourceService extends FileUploaderService implements AbstractFileUploader {
constructor() {
super(Store, AbstractStorage)
}
}
In order to invoke the superclass constructor properly, I need to provide these two arguments. While attempting to pass Store<AppState>
, it indicates that AppState
is being used as a value rather than a type. How can I accurately define this argument when invoking super? Any suggestions on how to declare this correctly?