Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-thunk

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-thunk - npm Package Compare versions

Comparing version 2.4.0 to 2.4.1

10

es/types.d.ts

@@ -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>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc