Last active
January 14, 2021 21:53
-
-
Save scriptex/ee5df515d73db6e0c3b042d2e451b122 to your computer and use it in GitHub Desktop.
Overwrite Swagger' fetch in React Native
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Constructor<T> = new (...args: any[]) => T; | |
function OverwriteFetch<T extends Constructor<{}>>(Base: T): Constructor<any> { | |
return class extends Base { | |
constructor(...args: any[]) { | |
super(...[...args, fetch]); | |
} | |
}; | |
} | |
@OverwriteFetch | |
export class ExtendedClass extends BaseClass {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment