@elementor/store 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.8.1](https://github.com/elementor/elementor-packages/compare/@elementor/store@0.8.0...@elementor/store@0.8.1) (2024-02-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **store:** dispatch & instance type [ED-13867] ([#165](https://github.com/elementor/elementor-packages/issues/165)) ([52ce6d9](https://github.com/elementor/elementor-packages/commit/52ce6d9c9941fdb0591e3d990b69a39b4a81690e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [0.8.0](https://github.com/elementor/elementor-packages/compare/@elementor/store@0.7.1...@elementor/store@0.8.0) (2024-02-22)
|
|
7
18
|
|
|
8
19
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _reduxjs_toolkit_dist_configureStore from '@reduxjs/toolkit/dist/configureStore';
|
|
2
2
|
import * as redux from 'redux';
|
|
3
|
-
import { Slice, Middleware, AnyAction, ThunkMiddleware
|
|
3
|
+
import { Slice, Middleware, AnyAction, ThunkMiddleware } from '@reduxjs/toolkit';
|
|
4
4
|
export { Action, AnyAction, CreateSliceOptions, Dispatch, Middleware, MiddlewareAPI, PayloadAction, Slice, Store, createAsyncThunk as __createAsyncThunk, createSelector as __createSelector, createSlice as __createSlice } from '@reduxjs/toolkit';
|
|
5
5
|
export { Provider as __StoreProvider, useDispatch as __useDispatch, useSelector as __useSelector } from 'react-redux';
|
|
6
6
|
|
|
@@ -18,11 +18,11 @@ type SliceState<S extends Slice> = {
|
|
|
18
18
|
};
|
|
19
19
|
declare function registerSlice(slice: Slice): void;
|
|
20
20
|
declare const addMiddleware: (middleware: Middleware) => void;
|
|
21
|
-
declare const dispatch: (action:
|
|
21
|
+
declare const dispatch: (action: any) => any;
|
|
22
22
|
declare const getState: () => any;
|
|
23
23
|
declare const subscribe: (listener: () => void) => redux.Unsubscribe;
|
|
24
24
|
declare const createStore: () => _reduxjs_toolkit_dist_configureStore.ToolkitStore<any, AnyAction, [ThunkMiddleware<any, AnyAction>]>;
|
|
25
|
-
declare const getStore: () =>
|
|
25
|
+
declare const getStore: () => _reduxjs_toolkit_dist_configureStore.ToolkitStore<any, AnyAction, [ThunkMiddleware<any, AnyAction>]> | null;
|
|
26
26
|
declare const deleteStore: () => void;
|
|
27
27
|
|
|
28
28
|
export { SliceState, addMiddleware as __addMiddleware, createStore as __createStore, deleteStore as __deleteStore, dispatch as __dispatch, getState as __getState, getStore as __getStore, registerSlice as __registerSlice, subscribe as __subscribe };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _reduxjs_toolkit_dist_configureStore from '@reduxjs/toolkit/dist/configureStore';
|
|
2
2
|
import * as redux from 'redux';
|
|
3
|
-
import { Slice, Middleware, AnyAction, ThunkMiddleware
|
|
3
|
+
import { Slice, Middleware, AnyAction, ThunkMiddleware } from '@reduxjs/toolkit';
|
|
4
4
|
export { Action, AnyAction, CreateSliceOptions, Dispatch, Middleware, MiddlewareAPI, PayloadAction, Slice, Store, createAsyncThunk as __createAsyncThunk, createSelector as __createSelector, createSlice as __createSlice } from '@reduxjs/toolkit';
|
|
5
5
|
export { Provider as __StoreProvider, useDispatch as __useDispatch, useSelector as __useSelector } from 'react-redux';
|
|
6
6
|
|
|
@@ -18,11 +18,11 @@ type SliceState<S extends Slice> = {
|
|
|
18
18
|
};
|
|
19
19
|
declare function registerSlice(slice: Slice): void;
|
|
20
20
|
declare const addMiddleware: (middleware: Middleware) => void;
|
|
21
|
-
declare const dispatch: (action:
|
|
21
|
+
declare const dispatch: (action: any) => any;
|
|
22
22
|
declare const getState: () => any;
|
|
23
23
|
declare const subscribe: (listener: () => void) => redux.Unsubscribe;
|
|
24
24
|
declare const createStore: () => _reduxjs_toolkit_dist_configureStore.ToolkitStore<any, AnyAction, [ThunkMiddleware<any, AnyAction>]>;
|
|
25
|
-
declare const getStore: () =>
|
|
25
|
+
declare const getStore: () => _reduxjs_toolkit_dist_configureStore.ToolkitStore<any, AnyAction, [ThunkMiddleware<any, AnyAction>]> | null;
|
|
26
26
|
declare const deleteStore: () => void;
|
|
27
27
|
|
|
28
28
|
export { SliceState, addMiddleware as __addMiddleware, createStore as __createStore, deleteStore as __deleteStore, dispatch as __dispatch, getState as __getState, getStore as __getStore, registerSlice as __registerSlice, subscribe as __subscribe };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n\tReducersMapObject,\n\tconfigureStore,\n\tcombineReducers,\n\tMiddleware,\n\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n\tReducersMapObject,\n\tconfigureStore,\n\tcombineReducers,\n\tMiddleware,\n\tSlice,\n\tAnyAction,\n\tEnhancedStore,\n\tStoreEnhancer,\n\tThunkMiddleware,\n} from '@reduxjs/toolkit';\n\nexport type {\n\tSlice,\n\tCreateSliceOptions,\n\tPayloadAction,\n\tStore,\n\tDispatch,\n\tAnyAction,\n\tAction,\n\tMiddlewareAPI,\n\tMiddleware,\n} from '@reduxjs/toolkit';\n\nexport {\n\tcreateSelector as __createSelector,\n\tcreateSlice as __createSlice,\n\tcreateAsyncThunk as __createAsyncThunk,\n} from '@reduxjs/toolkit';\n\nexport {\n\tuseSelector as __useSelector,\n\tuseDispatch as __useDispatch,\n\tProvider as __StoreProvider,\n} from 'react-redux';\n\n/**\n * Usage:\n *\n * const mySlice = addSlice( ... );\n *\n * type MySliceState = SliceState<typeof mySlice>;\n *\n * const value = useSelector( ( state: MySliceState ) => state.mySlice.value );\n */\nexport type SliceState<S extends Slice> = {\n\t[ key in S['name'] ]: ReturnType<S['getInitialState']>;\n}\n\n// The `configureStore` function from Redux Toolkit infers its actions from the `reducers`\n// key of the initialization object. This is fine when creating the store statically, but\n// breaks in our case since we create the store dynamically, which means that TypeScript\n// can't infer the types. Therefore, we force the store to accept any actions using a\n// generic store type.\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyStore<State = any> = EnhancedStore<\n\tState,\n\tAnyAction,\n\t[ThunkMiddleware<State, AnyAction>],\n\t[StoreEnhancer]\n>\n\ninterface SlicesMap {\n\t[key: Slice['name']]: Slice;\n}\n\nlet instance: AnyStore | null = null;\nlet slices: SlicesMap = {};\nconst pendingActions: AnyAction[] = [];\nconst middlewares = new Set<Middleware>();\n\nconst getReducers = () => {\n\tconst reducers = Object.entries( slices ).reduce( ( reducersData: ReducersMapObject, [ name, slice ] ) => {\n\t\treducersData[ name ] = slice.reducer;\n\n\t\treturn reducersData;\n\t}, {} );\n\n\treturn combineReducers( reducers );\n};\n\nfunction registerSlice( slice: Slice ) {\n\tif ( slices[ slice.name ] ) {\n\t\tthrow new Error( `Slice with name \"${ slice.name }\" already exists.` );\n\t}\n\n\tslices[ slice.name ] = slice;\n}\n\nconst addMiddleware = ( middleware: Middleware ) => {\n\tmiddlewares.add( middleware );\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- See the comment above about `AnyStore`\nconst dispatch = ( action: any ) => {\n\tif ( ! instance ) {\n\t\tpendingActions.push( action );\n\n\t\treturn;\n\t}\n\n\treturn instance.dispatch( action );\n};\n\nconst getState = () => {\n\tif ( ! instance ) {\n\t\tthrow new Error( 'The store instance does not exist.' );\n\t}\n\n\treturn instance.getState();\n};\n\nconst subscribe = ( listener: () => void ) => {\n\tif ( ! instance ) {\n\t\tthrow new Error( 'The store instance does not exist.' );\n\t}\n\n\treturn instance.subscribe( listener );\n};\n\nconst createStore = () => {\n\tif ( instance ) {\n\t\tthrow new Error( 'The store instance already exists.' );\n\t}\n\n\tinstance = configureStore( {\n\t\treducer: getReducers(),\n\t\tmiddleware: ( getDefaultMiddleware ) => {\n\t\t\treturn [\n\t\t\t\t...getDefaultMiddleware(),\n\t\t\t\t...Array.from( middlewares ),\n\t\t\t];\n\t\t},\n\t} );\n\n\tif ( pendingActions.length ) {\n\t\tpendingActions.forEach( ( action ) => dispatch( action ) );\n\t\tpendingActions.length = 0;\n\t}\n\n\treturn instance as AnyStore;\n};\n\nconst getStore = () => {\n\treturn instance;\n};\n\nconst deleteStore = () => {\n\tinstance = null;\n\tslices = {};\n\tpendingActions.length = 0;\n\tmiddlewares.clear();\n};\n\nexport {\n\tregisterSlice as __registerSlice,\n\taddMiddleware as __addMiddleware,\n\tdispatch as __dispatch,\n\tgetState as __getState,\n\tsubscribe as __subscribe,\n\tcreateStore as __createStore,\n\tgetStore as __getStore,\n\tdeleteStore as __deleteStore,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAUO;AAcP,IAAAA,kBAIO;AAEP,yBAIO;AAiCP,IAAI,WAA4B;AAChC,IAAI,SAAoB,CAAC;AACzB,IAAM,iBAA8B,CAAC;AACrC,IAAM,cAAc,oBAAI,IAAgB;AAExC,IAAM,cAAc,MAAM;AACzB,QAAM,WAAW,OAAO,QAAS,MAAO,EAAE,OAAQ,CAAE,cAAiC,CAAE,MAAM,KAAM,MAAO;AACzG,iBAAc,IAAK,IAAI,MAAM;AAE7B,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AAEN,aAAO,g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1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n\tReducersMapObject,\n\tconfigureStore,\n\tcombineReducers,\n\tMiddleware,\n\
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n\tReducersMapObject,\n\tconfigureStore,\n\tcombineReducers,\n\tMiddleware,\n\tSlice,\n\tAnyAction,\n\tEnhancedStore,\n\tStoreEnhancer,\n\tThunkMiddleware,\n} from '@reduxjs/toolkit';\n\nexport type {\n\tSlice,\n\tCreateSliceOptions,\n\tPayloadAction,\n\tStore,\n\tDispatch,\n\tAnyAction,\n\tAction,\n\tMiddlewareAPI,\n\tMiddleware,\n} from '@reduxjs/toolkit';\n\nexport {\n\tcreateSelector as __createSelector,\n\tcreateSlice as __createSlice,\n\tcreateAsyncThunk as __createAsyncThunk,\n} from '@reduxjs/toolkit';\n\nexport {\n\tuseSelector as __useSelector,\n\tuseDispatch as __useDispatch,\n\tProvider as __StoreProvider,\n} from 'react-redux';\n\n/**\n * Usage:\n *\n * const mySlice = addSlice( ... );\n *\n * type MySliceState = SliceState<typeof mySlice>;\n *\n * const value = useSelector( ( state: MySliceState ) => state.mySlice.value );\n */\nexport type SliceState<S extends Slice> = {\n\t[ key in S['name'] ]: ReturnType<S['getInitialState']>;\n}\n\n// The `configureStore` function from Redux Toolkit infers its actions from the `reducers`\n// key of the initialization object. This is fine when creating the store statically, but\n// breaks in our case since we create the store dynamically, which means that TypeScript\n// can't infer the types. Therefore, we force the store to accept any actions using a\n// generic store type.\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyStore<State = any> = EnhancedStore<\n\tState,\n\tAnyAction,\n\t[ThunkMiddleware<State, AnyAction>],\n\t[StoreEnhancer]\n>\n\ninterface SlicesMap {\n\t[key: Slice['name']]: Slice;\n}\n\nlet instance: AnyStore | null = null;\nlet slices: SlicesMap = {};\nconst pendingActions: AnyAction[] = [];\nconst middlewares = new Set<Middleware>();\n\nconst getReducers = () => {\n\tconst reducers = Object.entries( slices ).reduce( ( reducersData: ReducersMapObject, [ name, slice ] ) => {\n\t\treducersData[ name ] = slice.reducer;\n\n\t\treturn reducersData;\n\t}, {} );\n\n\treturn combineReducers( reducers );\n};\n\nfunction registerSlice( slice: Slice ) {\n\tif ( slices[ slice.name ] ) {\n\t\tthrow new Error( `Slice with name \"${ slice.name }\" already exists.` );\n\t}\n\n\tslices[ slice.name ] = slice;\n}\n\nconst addMiddleware = ( middleware: Middleware ) => {\n\tmiddlewares.add( middleware );\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- See the comment above about `AnyStore`\nconst dispatch = ( action: any ) => {\n\tif ( ! instance ) {\n\t\tpendingActions.push( action );\n\n\t\treturn;\n\t}\n\n\treturn instance.dispatch( action );\n};\n\nconst getState = () => {\n\tif ( ! instance ) {\n\t\tthrow new Error( 'The store instance does not exist.' );\n\t}\n\n\treturn instance.getState();\n};\n\nconst subscribe = ( listener: () => void ) => {\n\tif ( ! instance ) {\n\t\tthrow new Error( 'The store instance does not exist.' );\n\t}\n\n\treturn instance.subscribe( listener );\n};\n\nconst createStore = () => {\n\tif ( instance ) {\n\t\tthrow new Error( 'The store instance already exists.' );\n\t}\n\n\tinstance = configureStore( {\n\t\treducer: getReducers(),\n\t\tmiddleware: ( getDefaultMiddleware ) => {\n\t\t\treturn [\n\t\t\t\t...getDefaultMiddleware(),\n\t\t\t\t...Array.from( middlewares ),\n\t\t\t];\n\t\t},\n\t} );\n\n\tif ( pendingActions.length ) {\n\t\tpendingActions.forEach( ( action ) => dispatch( action ) );\n\t\tpendingActions.length = 0;\n\t}\n\n\treturn instance as AnyStore;\n};\n\nconst getStore = () => {\n\treturn instance;\n};\n\nconst deleteStore = () => {\n\tinstance = null;\n\tslices = {};\n\tpendingActions.length = 0;\n\tmiddlewares.clear();\n};\n\nexport {\n\tregisterSlice as __registerSlice,\n\taddMiddleware as __addMiddleware,\n\tdispatch as __dispatch,\n\tgetState as __getState,\n\ts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,MAAO,oCAAqC;AAAA,EACvD;AAEA,aAAW,eAAgB;AAAA,IAC1B,SAAS,YAAY;AAAA,IACrB,YAAY,CAAE,yBAA0B;AACvC,aAAO;AAAA,QACN,GAAG,qBAAqB;AAAA,QACxB,GAAG,MAAM,KAAM,WAAY;AAAA,MAC5B;AAAA,IACD;AAAA,EACD,CAAE;AAEF,MAAK,eAAe,QAAS;AAC5B,mBAAe,QAAS,CAAE,WAAY,SAAU,MAAO,CAAE;AACzD,mBAAe,SAAS;AAAA,EACzB;AAEA,SAAO;AACR;AAEA,IAAM,WAAW,MAAM;AACtB,SAAO;AACR;AAEA,IAAM,cAAc,MAAM;AACzB,aAAW;AACX,WAAS,CAAC;AACV,iBAAe,SAAS;AACxB,cAAY,MAAM;AACnB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/store",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"@reduxjs/toolkit": "^1.9.7",
|
|
39
39
|
"react-redux": "^8.1.3"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "c763d760ec869f64709aa643e36e263653ebd871"
|
|
42
42
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
configureStore,
|
|
4
4
|
combineReducers,
|
|
5
5
|
Middleware,
|
|
6
|
-
Store,
|
|
7
6
|
Slice,
|
|
8
7
|
AnyAction,
|
|
9
8
|
EnhancedStore,
|
|
@@ -66,7 +65,7 @@ interface SlicesMap {
|
|
|
66
65
|
[key: Slice['name']]: Slice;
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
let instance:
|
|
68
|
+
let instance: AnyStore | null = null;
|
|
70
69
|
let slices: SlicesMap = {};
|
|
71
70
|
const pendingActions: AnyAction[] = [];
|
|
72
71
|
const middlewares = new Set<Middleware>();
|
|
@@ -93,7 +92,8 @@ const addMiddleware = ( middleware: Middleware ) => {
|
|
|
93
92
|
middlewares.add( middleware );
|
|
94
93
|
};
|
|
95
94
|
|
|
96
|
-
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- See the comment above about `AnyStore`
|
|
96
|
+
const dispatch = ( action: any ) => {
|
|
97
97
|
if ( ! instance ) {
|
|
98
98
|
pendingActions.push( action );
|
|
99
99
|
|