@react-pakistan/util-functions 1.7.34 → 1.8.2

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/hooks/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export * from './hooks';
1
+ export * from './use-selector';
2
+ export * from './use-change';
package/hooks/index.js CHANGED
@@ -10,4 +10,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./hooks"), exports);
13
+ __exportStar(require("./use-selector"), exports);
14
+ __exportStar(require("./use-change"), exports);
@@ -0,0 +1,2 @@
1
+ import { DependencyList, EffectCallback } from 'react';
2
+ export declare const useChange: (callback: EffectCallback, deps: DependencyList) => void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useChange = void 0;
4
+ const react_1 = require("react");
5
+ const useChange = (callback, deps) => {
6
+ const init = (0, react_1.useRef)(false);
7
+ (0, react_1.useEffect)(() => {
8
+ if (init.current) {
9
+ callback();
10
+ }
11
+ init.current = true;
12
+ }, [init, ...deps]);
13
+ };
14
+ exports.useChange = useChange;
@@ -7,4 +7,4 @@
7
7
  * @remarks
8
8
  */
9
9
  /** End file docs */
10
- export declare const useSelector: (selector: () => any) => void;
10
+ export declare const useSelector: (selector: () => void) => void;
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.7.34",
3
+ "version": "1.8.2",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -43,15 +43,17 @@
43
43
  "@babel/core": "^7.16.0",
44
44
  "@babel/eslint-parser": "^7.16.3",
45
45
  "@babel/preset-typescript": "^7.16.0",
46
- "@react-pakistan/eslint-config-shared": "^1.2.53",
47
- "@types/jest": "^27.0.2",
48
- "@types/node": "^16.11.7",
46
+ "@react-pakistan/eslint-config-shared": "^1.4.4",
47
+ "@types/jest": "^27.0.3",
48
+ "@types/node": "^16.11.11",
49
49
  "@types/react-redux": "^7.1.20",
50
- "@types/styled-components": "^5.1.15",
51
- "eslint": "^8.2.0",
50
+ "@types/styled-components": "^5.1.16",
51
+ "eslint": "^8.4.0",
52
52
  "husky": "^7.0.4",
53
- "jest": "^27.3.1",
54
- "lint-staged": "^12.0.2",
53
+ "jest": "^27.4.3",
54
+ "lint-staged": "^12.1.2",
55
+ "lodash.isequal": "^4.5.0",
56
+ "react": "^17.0.2",
55
57
  "react-redux": "^7.2.6",
56
58
  "rimraf": "^3.0.2",
57
59
  "ts-jest": "^27.0.7",
@@ -15,7 +15,7 @@ export interface IColors {
15
15
  [key: string]: string;
16
16
  }
17
17
  export interface IMisc {
18
- [key: string]: unknown;
18
+ [key: string]: string | number | boolean;
19
19
  }
20
20
  export interface IHeadingStyle {
21
21
  fontFamily: string;