redux-thunk
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -1,2 +0,2 @@ | ||
import { Action, AnyAction, Middleware, Dispatch } from 'redux'; | ||
import { Action, AnyAction, Middleware } from 'redux'; | ||
/** | ||
@@ -13,8 +13,8 @@ * The dispatch method as modified by React-Thunk; overloaded so that you can | ||
*/ | ||
export interface ThunkDispatch<State, ExtraThunkArg, BasicAction extends Action> extends Dispatch<BasicAction> { | ||
export interface ThunkDispatch<State, ExtraThunkArg, BasicAction extends Action> { | ||
/** Accepts a thunk function, runs it, and returns whatever the thunk itself returns */ | ||
<ReturnType>(thunkAction: ThunkAction<ReturnType, State, ExtraThunkArg, BasicAction>): ReturnType; | ||
/** A union of the other two overloads. This overload exists to work around a problem | ||
* with TS inference ( see https://github.com/microsoft/TypeScript/issues/14107 ) | ||
*/ | ||
/** Accepts a standard action object, and returns that action object */ | ||
<Action extends BasicAction>(action: Action): Action; | ||
/** A union of the other two overloads for TS inference purposes */ | ||
<ReturnType, Action extends BasicAction>(action: Action | ThunkAction<ReturnType, State, ExtraThunkArg, BasicAction>): Action | ReturnType; | ||
@@ -21,0 +21,0 @@ } |
{ | ||
"name": "redux-thunk", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Thunk middleware for Redux.", |
@@ -63,3 +63,3 @@ # Redux Thunk | ||
Additionally, since 2.x, we also support a | ||
[UMD build](https://unpkg.com/redux-thunk/dist/redux-thunk.min.js): | ||
[UMD build](https://unpkg.com/redux-thunk/dist/redux-thunk.min.js) for use as a global script tag: | ||
@@ -80,3 +80,2 @@ ```js | ||
// Note: this API requires redux@>=3.1.0 | ||
const store = createStore(rootReducer, applyMiddleware(thunk)) | ||
@@ -83,0 +82,0 @@ ``` |
@@ -14,9 +14,10 @@ import { Action, AnyAction, Middleware, Dispatch } from 'redux' | ||
*/ | ||
export interface ThunkDispatch<State, ExtraThunkArg, BasicAction extends Action> | ||
extends Dispatch<BasicAction> { | ||
// When the thunk middleware is added, `store.dispatch` now has three overloads: | ||
export interface ThunkDispatch< | ||
State, | ||
ExtraThunkArg, | ||
BasicAction extends Action | ||
> { | ||
// When the thunk middleware is added, `store.dispatch` now has three overloads (NOTE: the order here matters for correct behavior and is very fragile - do not reorder these!): | ||
// 1) The base overload, which accepts a standard action object, and returns that action object | ||
// 2) The specific thunk function overload | ||
// 1) The specific thunk function overload | ||
/** Accepts a thunk function, runs it, and returns whatever the thunk itself returns */ | ||
@@ -27,6 +28,9 @@ <ReturnType>( | ||
// 3) | ||
/** A union of the other two overloads. This overload exists to work around a problem | ||
* with TS inference ( see https://github.com/microsoft/TypeScript/issues/14107 ) | ||
*/ | ||
// 2) The base overload. | ||
/** Accepts a standard action object, and returns that action object */ | ||
<Action extends BasicAction>(action: Action): Action | ||
// 3) A union of the other two overloads. This overload exists to work around a problem | ||
// with TS inference ( see https://github.com/microsoft/TypeScript/issues/14107 ) | ||
/** A union of the other two overloads for TS inference purposes */ | ||
<ReturnType, Action extends BasicAction>( | ||
@@ -33,0 +37,0 @@ action: Action | ThunkAction<ReturnType, State, ExtraThunkArg, BasicAction> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
32069
320
0
407