@redhat-cloud-services/frontend-components-utilities 3.2.17 → 3.2.18

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.
@@ -1,19 +1,19 @@
1
- import { compose, ActionCreator } from 'redux';
1
+ import { compose, ActionCreator, Store, Reducer, Middleware } from 'redux';
2
2
  export declare function applyReducerHash(reducerHash: any, initialState?: Record<string, unknown>): (state: Record<string, unknown> | undefined, action: {
3
3
  type: PropertyKey;
4
4
  }) => any;
5
- export declare function dispatchActionsToStore(actions: Record<string, ActionCreator<any>>, store: any): Record<string, ActionCreator<any>>;
5
+ export declare function dispatchActionsToStore<T extends Record<string, ActionCreator<any>>>(actions: Record<string, ActionCreator<any>>, store: Store): T;
6
6
  declare global {
7
7
  interface Window {
8
8
  REDUX_DEVTOOLS_EXTENSION_COMPOSE?: typeof compose;
9
9
  }
10
10
  }
11
- export declare class ReducerRegistry {
12
- store: any;
13
- reducers: Record<string, any>;
14
- constructor(initState?: any, middlewares?: never[], composeEnhancersDefault?: typeof compose);
15
- getStore(): any;
16
- register(newReducers: Record<string, any>): () => void;
11
+ export declare class ReducerRegistry<T extends Record<string, unknown>> {
12
+ store: Store;
13
+ reducers: Record<string, Reducer>;
14
+ constructor(initState?: T, middlewares?: Middleware[], composeEnhancersDefault?: typeof compose);
15
+ getStore(): Store<T>;
16
+ register(newReducers: Record<string, Reducer>): () => void;
17
17
  }
18
- export declare const reduxRegistry: ReducerRegistry;
18
+ export declare const reduxRegistry: ReducerRegistry<Record<string, unknown>>;
19
19
  export default ReducerRegistry;
@@ -58,7 +58,10 @@ var ReducerRegistry = (function () {
58
58
  this.store.replaceReducer((0, redux_1.combineReducers)(__assign({}, this.reducers)));
59
59
  return function () {
60
60
  _this.reducers = Object.entries(_this.reducers)
61
- .filter(function (reducer) { return !Object.keys(newReducers).includes(reducer); })
61
+ .filter(function (_a) {
62
+ var reducer = _a[0];
63
+ return !Object.keys(newReducers).includes(reducer);
64
+ })
62
65
  .reduce(function (acc, _a) {
63
66
  var _b;
64
67
  var key = _a[0], val = _a[1];
@@ -53,7 +53,10 @@ var ReducerRegistry = (function () {
53
53
  this.store.replaceReducer(combineReducers(__assign({}, this.reducers)));
54
54
  return function () {
55
55
  _this.reducers = Object.entries(_this.reducers)
56
- .filter(function (reducer) { return !Object.keys(newReducers).includes(reducer); })
56
+ .filter(function (_a) {
57
+ var reducer = _a[0];
58
+ return !Object.keys(newReducers).includes(reducer);
59
+ })
57
60
  .reduce(function (acc, _a) {
58
61
  var _b;
59
62
  var key = _a[0], val = _a[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redhat-cloud-services/frontend-components-utilities",
3
- "version": "3.2.17",
3
+ "version": "3.2.18",
4
4
  "description": "Util functions for RedHat Cloud Services project.",
5
5
  "main": "index.js",
6
6
  "module": "esm/index.js",