function UsefulDecorator<T extends new (...args) => any>(
BaseClass: T,
): T {
return class _usefulClass extends BaseClass {
private _someStore: typeof SomeStore = SomeStore;
addtionalProp = 0;
public render() {
return <BaseClass {...this.props} />;
}
};
}
export default UsefulDecorator;
Created
March 22, 2021 04:35
-
-
Save sar/2ee1947076d4d6b2b9d47ccc6e106638 to your computer and use it in GitHub Desktop.
Quick guide on constructing TypeScript @decorators
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment