🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

redux

Package Overview
Dependencies
Maintainers
6
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux - npm Package Compare versions

Comparing version

to
5.0.1

15

dist/redux.d.ts

@@ -208,3 +208,3 @@ /**

*/
interface Store<S = any, A extends Action = UnknownAction, StateExt extends {} = {}> {
interface Store<S = any, A extends Action = UnknownAction, StateExt extends unknown = unknown> {
/**

@@ -286,2 +286,3 @@ * Dispatches an action. It is the only way to trigger a state change.

}
type UnknownIfNonSpecific<T> = {} extends T ? unknown : T;
/**

@@ -300,4 +301,4 @@ * A store creator is a function that creates a Redux store. Like with

interface StoreCreator {
<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, StateExt> & Ext;
<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext>): Store<S, A, StateExt> & Ext;
<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;
<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;
}

@@ -353,3 +354,3 @@ /**

*/
declare function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, StateExt> & Ext;
declare function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;
/**

@@ -380,3 +381,3 @@ * @deprecated

*/
declare function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, StateExt> & Ext;
declare function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;
/**

@@ -412,3 +413,3 @@ * Creates a Redux store that holds the state tree.

*/
declare function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, StateExt> & Ext;
declare function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;
/**

@@ -444,3 +445,3 @@ * Creates a Redux store that holds the state tree.

*/
declare function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, StateExt> & Ext;
declare function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;

@@ -447,0 +448,0 @@ /**

@@ -27,3 +27,3 @@ // src/utils/formatProdErrorMessage.ts

}
return Object.getPrototypeOf(obj) === proto;
return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
}

@@ -30,0 +30,0 @@

{
"name": "redux",
"version": "5.0.0",
"version": "5.0.1",
"description": "Predictable state container for JavaScript apps",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -8,3 +8,4 @@ import $$observable from './utils/symbol-observable'

Observer,
ListenerCallback
ListenerCallback,
UnknownIfNonSpecific
} from './types/store'

@@ -50,3 +51,3 @@ import { Action } from './types/actions'

enhancer?: StoreEnhancer<Ext, StateExt>
): Store<S, A, StateExt> & Ext
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext
/**

@@ -87,3 +88,3 @@ * @deprecated

enhancer?: StoreEnhancer<Ext, StateExt>
): Store<S, A, StateExt> & Ext
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext
export function createStore<

@@ -99,3 +100,3 @@ S,

enhancer?: StoreEnhancer<Ext, StateExt>
): Store<S, A, StateExt> & Ext {
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {
if (typeof reducer !== 'function') {

@@ -439,3 +440,3 @@ throw new Error(

enhancer?: StoreEnhancer<Ext, StateExt>
): Store<S, A, StateExt> & Ext
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext
/**

@@ -481,3 +482,3 @@ * Creates a Redux store that holds the state tree.

enhancer?: StoreEnhancer<Ext, StateExt>
): Store<S, A, StateExt> & Ext
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext
export function legacy_createStore<

@@ -493,4 +494,4 @@ S,

enhancer?: StoreEnhancer<Ext, StateExt>
): Store<S, A, StateExt> & Ext {
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {
return createStore(reducer, preloadedState as any, enhancer)
}

@@ -84,3 +84,3 @@ import { Action, UnknownAction } from './actions'

A extends Action = UnknownAction,
StateExt extends {} = {}
StateExt extends unknown = unknown
> {

@@ -168,2 +168,4 @@ /**

export type UnknownIfNonSpecific<T> = {} extends T ? unknown : T
/**

@@ -185,3 +187,3 @@ * A store creator is a function that creates a Redux store. Like with

enhancer?: StoreEnhancer<Ext, StateExt>
): Store<S, A, StateExt> & Ext
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext
<

@@ -197,3 +199,3 @@ S,

enhancer?: StoreEnhancer<Ext>
): Store<S, A, StateExt> & Ext
): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext
}

@@ -200,0 +202,0 @@

@@ -13,3 +13,5 @@ /**

return Object.getPrototypeOf(obj) === proto
return (
Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null
)
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet