Skip to content

Commit e263d4d

Browse files
authored
fix: take return type should have predicate action type
When using take with a timeout of type number | undefined, the returned action was typed as AnyAction despite being able to know its type from the predicate.
1 parent 1751eb9 commit e263d4d

File tree

1 file changed

+1
-1
lines changed
  • packages/toolkit/src/listenerMiddleware

1 file changed

+1
-1
lines changed

packages/toolkit/src/listenerMiddleware/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export interface TakePattern<State> {
363363
<Predicate extends AnyListenerPredicate<State>>(
364364
predicate: Predicate,
365365
timeout?: number | undefined
366-
): Promise<[AnyAction, State, State] | null>
366+
): TakePatternOutputWithTimeout<State, Predicate>
367367
}
368368

369369
/** @public */

0 commit comments

Comments
 (0)