Skip to content

Commit c6416bc

Browse files
committed
FEAT: Change generic order from OuterProps, InnerProps to InnerProps, OuterProps (recompose style)
1 parent a9e8d3c commit c6416bc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

index.d.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ interface ComponentDecorator<TOriginalProps, TOuterProps> {
55
(component: React.ComponentClass<TOriginalProps> | React.StatelessComponent<TOriginalProps>): React.ComponentClass<TOuterProps>;
66
}
77

8-
interface MapStateToProps<Store, TOuterProps, TMappedProps> {
9-
(state: Store, ownProps?: TOuterProps): TMappedProps;
10-
}
11-
12-
138
export class SharedStore<State = {}> {
149
state: State
1510

@@ -23,15 +18,19 @@ export class EnhancedComponent<Store extends SharedStore, P = any, S = any> exte
2318
sharedStore: Store
2419
}
2520

21+
interface MapStateToProps<Store, TInnerProps, TOuterProps, > {
22+
(state: Store, ownProps: TOuterProps): TInnerProps;
23+
}
24+
2625
export function getProvider<Store extends SharedStore>(
2726
name: string,
2827
StoreClass?: new(storeName: string, initialState?: any) => Store
2928
): {
3029
new(): EnhancedComponent<Store>
31-
connect<TOuterProps, TInnerProps>(mapStoreToProps: MapStateToProps<Store, TOuterProps, TInnerProps>): ComponentDecorator<TInnerProps, TOuterProps>
30+
connect<TInnerProps, TOuterProps>(mapStoreToProps: MapStateToProps<Store, TInnerProps, TOuterProps>): ComponentDecorator<TInnerProps, TOuterProps>
3231
}
3332

34-
export function connect<Store, TOuterProps, TInnerProps>(
33+
export function connect<Store, TInnerProps, TOuterProps>(
3534
name: string,
3635
mapStateToProps?: MapStateToProps<Store, TOuterProps, TInnerProps>,
3736
): ComponentDecorator<TInnerProps, TOuterProps>;

0 commit comments

Comments
 (0)