Skip to content

Commit

Permalink
Merge pull request #7 from agrasley/master
Browse files Browse the repository at this point in the history
revert reordering of ThunkAction type params
  • Loading branch information
itaylor committed Jul 16, 2019
2 parents ce99a9a + fb6e809 commit 208de0c
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 55 deletions.
10 changes: 5 additions & 5 deletions packages/redux-action-router/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export declare function actionHandler<
TState = {},
TExtraThunkArg = undefined,
TBasicAction extends Action = AnyAction,
TAction extends TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown> = TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown>,
TAction extends TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction> = TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction>,
TReturnType = unknown,
TStore extends Store<TState, TBasicAction> & { dispatch: ThunkDispatch<TState, TExtraThunkArg, TBasicAction> } =
Store<TState, TBasicAction> & { dispatch: ThunkDispatch<TState, TExtraThunkArg, TBasicAction> }
Expand All @@ -30,7 +30,7 @@ export declare function dispatcher<
TBasicAction extends Action,
>(
store: { dispatch: ThunkDispatch<TState, TExtraThunkArg, TBasicAction> },
match: (values: TValues) => TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown>,
match: (values: TValues) => TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction>,
values: TValues,
path: string
): void;
Expand All @@ -41,7 +41,7 @@ export interface RoutesMap<
TBasicAction extends Action,
TValues = any
> {
[url: string]: (values: TValues) => TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown>;
[url: string]: (values: TValues) => TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction>;
}

export interface UrlSupport {
Expand All @@ -60,12 +60,12 @@ export interface ActionRouterOpts<
> {
dispatcher?: (
store: TStore,
match: (values: TValues) => TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown>,
match: (values: TValues) => TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction>,
values: TValues,
path: string
) => void;
actionHandler?: <
TAction extends TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown> = TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown>,
TAction extends TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction> = TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction>,
TReturnType = unknown,
>(store: TStore, next: (action: TAction) => TReturnType, action: TAction) => TReturnType;
urlSupport?: (onChange: (url: string) => void) => UrlSupport;
Expand Down
6 changes: 3 additions & 3 deletions packages/redux-action-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"author": "ian.b.taylor@gmail.com",
"license": "MIT",
"peerDependencies": {
"redux": "^4.0.1",
"redux": "^4.0.3",
"redux-thunk-recursion-detect": "^1.1.1"
},
"devDependencies": {
"jest": "^24.8.0",
"redux": "^4.0.1",
"redux": "^4.0.3",
"redux-thunk": "^2.3.0",
"redux-thunk-recursion-detect": "^1.1.2",
"redux-thunk-recursion-detect": "1.1.1",
"rollup": "^1.15.3"
},
"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/redux-action-router/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,7 @@ realpath-native@^1.1.0:
dependencies:
util.promisify "^1.0.0"

redux-thunk-recursion-detect@^1.1.1:
redux-thunk-recursion-detect@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/redux-thunk-recursion-detect/-/redux-thunk-recursion-detect-1.1.1.tgz#7f1b13d0442bc287f37bb46e2d6943dab13d0f00"
integrity sha512-s50xHim5GJJQ1s5ZFXx43ZxP1L7041Fa/ZkDn+MKvmsWd0oP7wCjQPjX3LUu6fUrlyKdY1hS60cQcMV53nvC3g==
Expand All @@ -2624,10 +2624,10 @@ redux-thunk@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"

redux@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.1.tgz#436cae6cc40fbe4727689d7c8fae44808f1bfef5"
integrity sha512-R7bAtSkk7nY6O/OYMVR9RiBI+XghjF9rlbl5806HJbQph0LJVHZrU5oaO4q70eUKiqMRqm4y07KLTlMZ2BlVmg==
redux@^4.0.3:
version "4.0.4"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796"
integrity sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q==
dependencies:
loose-envify "^1.4.0"
symbol-observable "^1.2.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/redux-awaitable-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"author": "ian.b.taylor@gmail.com",
"license": "MIT",
"peerDependencies": {
"redux": "^4.0.1"
"redux": "^4.0.3"
},
"devDependencies": {
"jest": "^24.8.0",
"redux": "^4.0.1",
"redux": "^4.0.3",
"redux-thunk": "^2.3.0",
"rollup": "^1.15.3"
}
Expand Down
8 changes: 4 additions & 4 deletions packages/redux-awaitable-state/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2615,10 +2615,10 @@ redux-thunk@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"

redux@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.1.tgz#436cae6cc40fbe4727689d7c8fae44808f1bfef5"
integrity sha512-R7bAtSkk7nY6O/OYMVR9RiBI+XghjF9rlbl5806HJbQph0LJVHZrU5oaO4q70eUKiqMRqm4y07KLTlMZ2BlVmg==
redux@^4.0.3:
version "4.0.4"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796"
integrity sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q==
dependencies:
loose-envify "^1.4.0"
symbol-observable "^1.2.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/redux-awaitable-thunk/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export declare function awaitableThunk<
TName extends string,
TReturnTypeConstraint,
TReturnType extends TReturnTypeConstraint,
>(name: TName, thunk: ThunkAction<TState, TExtraThunkArg, TBasicAction, TReturnType>):
>(name: TName, thunk: ThunkAction<TReturnType, TState, TExtraThunkArg, TBasicAction>):
Required<AwaitableThunkAction<TState, TExtraThunkArg, TBasicAction, TReturnTypeConstraint, TReturnType, TName, TName>>;

export declare function after(name: string): Promise<void>;
Expand All @@ -27,7 +27,7 @@ export interface AwaitableThunkAction<
TReturnType extends TReturnTypeConstraint = TReturnTypeConstraint,
TAwaitableNames extends string = string,
TName extends TAwaitableNames = TAwaitableNames,
> extends ThunkAction<TState, TExtraThunkArg, TBasicAction, TReturnType> {
> extends ThunkAction<TReturnType, TState, TExtraThunkArg, TBasicAction> {
(
dispatch: AwaitableThunkDispatch<TState, TExtraThunkArg, TBasicAction, TReturnTypeConstraint, TAwaitableNames>,
getState: () => TState,
Expand Down
6 changes: 3 additions & 3 deletions packages/redux-awaitable-thunk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
"await"
],
"peerDependencies": {
"redux": "^4.0.1",
"redux": "^4.0.3",
"redux-thunk-recursion-detect": "^1.1.1"
},
"author": "ian.b.taylor@gmail.com",
"license": "MIT",
"devDependencies": {
"jest": "^24.8.0",
"redux": "^4.0.1",
"redux": "^4.0.3",
"redux-thunk": "^2.3.0",
"redux-thunk-recursion-detect": "^1.1.2",
"redux-thunk-recursion-detect": "1.1.1",
"rollup": "^1.15.3"
}
}
10 changes: 5 additions & 5 deletions packages/redux-awaitable-thunk/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2611,7 +2611,7 @@ realpath-native@^1.1.0:
dependencies:
util.promisify "^1.0.0"

redux-thunk-recursion-detect@^1.1.1:
redux-thunk-recursion-detect@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/redux-thunk-recursion-detect/-/redux-thunk-recursion-detect-1.1.1.tgz#7f1b13d0442bc287f37bb46e2d6943dab13d0f00"
integrity sha512-s50xHim5GJJQ1s5ZFXx43ZxP1L7041Fa/ZkDn+MKvmsWd0oP7wCjQPjX3LUu6fUrlyKdY1hS60cQcMV53nvC3g==
Expand All @@ -2620,10 +2620,10 @@ redux-thunk@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"

redux@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.1.tgz#436cae6cc40fbe4727689d7c8fae44808f1bfef5"
integrity sha512-R7bAtSkk7nY6O/OYMVR9RiBI+XghjF9rlbl5806HJbQph0LJVHZrU5oaO4q70eUKiqMRqm4y07KLTlMZ2BlVmg==
redux@^4.0.3:
version "4.0.4"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796"
integrity sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q==
dependencies:
loose-envify "^1.4.0"
symbol-observable "^1.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/redux-socket.io-error-thunk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"jest": "^24.8.0",
"redux": "^4.0.3",
"redux-thunk-recursion-detect": "^1.1.2",
"redux-thunk-recursion-detect": "1.1.1",
"rollup": "^1.15.3"
},
"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/redux-socket.io-error-thunk/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2614,15 +2614,15 @@ realpath-native@^1.1.0:
dependencies:
util.promisify "^1.0.0"

redux-thunk-recursion-detect@^1.1.1:
redux-thunk-recursion-detect@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/redux-thunk-recursion-detect/-/redux-thunk-recursion-detect-1.1.1.tgz#7f1b13d0442bc287f37bb46e2d6943dab13d0f00"
integrity sha512-s50xHim5GJJQ1s5ZFXx43ZxP1L7041Fa/ZkDn+MKvmsWd0oP7wCjQPjX3LUu6fUrlyKdY1hS60cQcMV53nvC3g==

redux@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.1.tgz#436cae6cc40fbe4727689d7c8fae44808f1bfef5"
integrity sha512-R7bAtSkk7nY6O/OYMVR9RiBI+XghjF9rlbl5806HJbQph0LJVHZrU5oaO4q70eUKiqMRqm4y07KLTlMZ2BlVmg==
redux@^4.0.3:
version "4.0.4"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796"
integrity sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q==
dependencies:
loose-envify "^1.4.0"
symbol-observable "^1.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/redux-socket.io-message-thunk/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface IoMessageHandlers<
TExtraThunkArg,
TBasicAction extends Action,
> {
[type: string]: (message: any) => TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown>;
[type: string]: (message: any) => TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction>;
}

declare function createIoMessageMiddleware<
Expand Down
6 changes: 3 additions & 3 deletions packages/redux-socket.io-message-thunk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"author": "ian.b.taylor@gmail.com",
"license": "MIT",
"peerDependencies": {
"redux": "^4.0.3",
"redux-thunk-recursion-detect": "^1.1.1"
"redux-thunk-recursion-detect": "^1.1.1",
"redux": "^4.0.3"
},
"devDependencies": {
"jest": "^24.8.0",
"redux": "^4.0.3",
"redux-thunk-recursion-detect": "^1.1.2",
"redux-thunk-recursion-detect": "1.1.0",
"rollup": "^1.15.3"
}
}
8 changes: 4 additions & 4 deletions packages/redux-socket.io-message-thunk/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2611,10 +2611,10 @@ realpath-native@^1.1.0:
dependencies:
util.promisify "^1.0.0"

redux-thunk-recursion-detect@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/redux-thunk-recursion-detect/-/redux-thunk-recursion-detect-1.1.1.tgz#7f1b13d0442bc287f37bb46e2d6943dab13d0f00"
integrity sha512-s50xHim5GJJQ1s5ZFXx43ZxP1L7041Fa/ZkDn+MKvmsWd0oP7wCjQPjX3LUu6fUrlyKdY1hS60cQcMV53nvC3g==
redux-thunk-recursion-detect@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/redux-thunk-recursion-detect/-/redux-thunk-recursion-detect-1.1.0.tgz#b61c347d04dfb5c9acf5c3764691b305b321300c"
integrity sha512-uI5VltNx4Rkr/2LrfN8vFLW7nRuaeeAM+S+gCiqbW7uYEvlJiKWY2fMMyes9Rh7FbaC6NxA3caPGNIRkJjW1lw==

redux@^4.0.3:
version "4.0.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/redux-thunk-error-handler/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ declare function createThunkErrorCatchMiddleware<
TState = {},
TExtraThunkArg = undefined,
TBasicAction extends Action = AnyAction,
>(config: { onError(error: unknown): TBasicAction | ThunkAction<TState, TExtraThunkArg, TBasicAction, unknown> | void }): Middleware<
>(config: { onError(error: unknown): TBasicAction | ThunkAction<unknown, TState, TExtraThunkArg, TBasicAction> | void }): Middleware<
{},
TState,
ThunkDispatch<TState, TExtraThunkArg, TBasicAction>
>;

export declare function forceHandleError<
TReturnType,
TState,
TExtraThunkArg,
TBasicAction extends Action,
TReturnType
>(thunkFn: ThunkAction<TState, TExtraThunkArg, TBasicAction, TReturnType>): ThunkAction<TState, TExtraThunkArg, TBasicAction, TReturnType>;
>(thunkFn: ThunkAction<TReturnType, TState, TExtraThunkArg, TBasicAction>): ThunkAction<TReturnType, TState, TExtraThunkArg, TBasicAction>;

export declare const handleErrorsSymbol: symbol;
export default createThunkErrorCatchMiddleware;
2 changes: 1 addition & 1 deletion packages/redux-thunk-error-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
"rollup": "^1.15.3"
},
"dependencies": {
"redux-thunk-recursion-detect": "^1.1.2"
"redux-thunk-recursion-detect": "1.1.1"
}
}
2 changes: 1 addition & 1 deletion packages/redux-thunk-error-handler/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2828,7 +2828,7 @@ realpath-native@^1.1.0:
dependencies:
util.promisify "^1.0.0"

redux-thunk-recursion-detect@^1.1.1:
redux-thunk-recursion-detect@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/redux-thunk-recursion-detect/-/redux-thunk-recursion-detect-1.1.1.tgz#7f1b13d0442bc287f37bb46e2d6943dab13d0f00"
integrity sha512-s50xHim5GJJQ1s5ZFXx43ZxP1L7041Fa/ZkDn+MKvmsWd0oP7wCjQPjX3LUu6fUrlyKdY1hS60cQcMV53nvC3g==
Expand Down
10 changes: 3 additions & 7 deletions packages/redux-thunk-recursion-detect/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ import {
* @template TExtraThunkArg The extra argument passed to the inner function of
* thunks (if specified when setting up the Thunk middleware)
* @template TBasicAction The (non-thunk) actions that can be dispatched.
* @template TReturnTypeConstraint Gives the ability to restrain the possible
* thunk return types
*/
export interface ThunkDispatch<
TState,
TExtraThunkArg,
TBasicAction extends Action,
> {
<TReturnType>(
thunkAction: ThunkAction<TState, TExtraThunkArg, TBasicAction, TReturnType>
thunkAction: ThunkAction<TReturnType, TState, TExtraThunkArg, TBasicAction>
): TReturnType;
<A extends TBasicAction>(action: A): A;
}
Expand All @@ -42,14 +40,12 @@ export interface ThunkDispatch<
* @template TExtraThunkARg Optional extra argument passed to the inner function
* (if specified when setting up the Thunk middleware)
* @template TBasicAction The (non-thunk) actions that can be dispatched.
* @template TReturnTypeConstraint Gives the ability to restrain the possible
* thunk return types
*/
export type ThunkAction<
TReturnType,
TState,
TExtraThunkArg,
TBasicAction extends Action,
TReturnType
TBasicAction extends Action
> = (
dispatch: ThunkDispatch<TState, TExtraThunkArg, TBasicAction>,
getState: () => TState,
Expand Down

0 comments on commit 208de0c

Please sign in to comment.