Skip to content

Commit dfa7f3c

Browse files
committed
fix: remove connectAdvanced\'s {} as any
1 parent 2832679 commit dfa7f3c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/connectAdvanced.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,15 @@ export interface ConnectAdvancedOptions {
182182
pure?: boolean
183183
}
184184

185+
interface AnyObject {
186+
[x: string]: any
187+
}
188+
185189
export default function connectAdvanced<
186190
S,
187191
TProps,
188192
TOwnProps,
189-
TFactoryOptions = {}
193+
TFactoryOptions extends AnyObject = {}
190194
>(
191195
/*
192196
selectorFactory is a func that is responsible for returning the selector function used to
@@ -205,7 +209,7 @@ export default function connectAdvanced<
205209
props. Do not use connectAdvanced directly without memoizing results between calls to your
206210
selector, otherwise the Connect component will re-render on every state or props change.
207211
*/
208-
selectorFactory: SelectorFactory<S, TProps, TOwnProps, TFactoryOptions>,
212+
selectorFactory: SelectorFactory<S, TProps, TOwnProps, unknown>,
209213
// options object:
210214
{
211215
// the func used to compute this HOC's displayName from the wrapped component's displayName.
@@ -227,7 +231,7 @@ export default function connectAdvanced<
227231

228232
// additional options are passed through to the selectorFactory
229233
...connectOptions
230-
}: ConnectAdvancedOptions & TFactoryOptions = {} as any
234+
}: ConnectAdvancedOptions & Partial<TFactoryOptions> = {}
231235
) {
232236
const Context = context
233237

0 commit comments

Comments
 (0)