Can anyone provide some assistance with this issue?
I am working on extending a class from a 3rd party and I need to pass data dynamically. This is the class structure:
class AuthGuardNew extends AuthGuard("Needs changing") {
}
What I would like to achieve is to do something like this:
new AuthGuardNew("Something different")
This way, "Something different" will be passed to the extended class instead of "Needs Changing."
If I use a constructor like this:
constructor(type:string) {
}
But how can I pass this into AuthGuard when it has already been extended?
Any suggestions or ideas to tackle this challenge are greatly appreciated.
Thank you in advance.
UPDATE
When I try to implement the following:
export class AuthGuardNew extends AuthGuard {
constructor(type?: string) {
super(type)
}
I encounter a typescript error stating that:
Type '(type?: string | undefined) => Type' is not a constructor function type.