Skip to content

Commit

Permalink
fix(react-composition): remove unused generic
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 committed Apr 5, 2024
1 parent eff32b4 commit 72690f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/react-composition/src/decorators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export function createDecoratorFactory<TDecorator>() {
};
}

export function createHookDecoratorFactory<TDecorator>() {
export function createHookDecoratorFactory() {
return function from<TDecoratable extends DecoratableComponent>(decoratable: TDecoratable) {
return function createDecorator(decorator: Decorator<GetDecoratee<TDecoratable>>) {
return function DecoratorPlugin(props: TDecorator) {
return function DecoratorPlugin() {
return (
<Compose
function={decoratable}
Expand All @@ -92,9 +92,9 @@ export function withDecoratorFactory<TDecorator>() {
};
}

export function withHookDecoratorFactory<TDecorator>() {
export function withHookDecoratorFactory() {
return function WithHookDecorator<TDecoratable extends DecoratableHook>(hook: TDecoratable) {
const createDecorator = createHookDecoratorFactory<TDecorator>()(hook);
const createDecorator = createHookDecoratorFactory()(hook);

return Object.assign(hook, { createDecorator }) as unknown as DecoratableHook<
GenericHook<GetDecorateeParams<GetDecoratee<TDecoratable>>>
Expand Down

0 comments on commit 72690f4

Please sign in to comment.