@pushwoosh/kit-helpers 4.12.4 → 4.12.5
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/callWithRetry.js +0 -2
- package/expand.js +0 -1
- package/hooks/useAsyncFn.js +0 -1
- package/hooks/useAsyncFunction.js +0 -1
- package/hooks/useClickAway.js +0 -1
- package/package.json +17 -20
package/callWithRetry.js
CHANGED
|
@@ -27,7 +27,6 @@ export const callWithRetry = async (operation, policy) => {
|
|
|
27
27
|
};
|
|
28
28
|
for (let attempt = 1; attempt <= policy.attempts; attempt += 1) {
|
|
29
29
|
try {
|
|
30
|
-
// eslint-disable-next-line no-await-in-loop
|
|
31
30
|
const result = await operation(attempt);
|
|
32
31
|
if (!policy.until || policy.until(result)) {
|
|
33
32
|
return result;
|
|
@@ -45,7 +44,6 @@ export const callWithRetry = async (operation, policy) => {
|
|
|
45
44
|
};
|
|
46
45
|
}
|
|
47
46
|
if (attempt < policy.attempts) {
|
|
48
|
-
// eslint-disable-next-line no-await-in-loop
|
|
49
47
|
await sleep(policy.delay);
|
|
50
48
|
}
|
|
51
49
|
}
|
package/expand.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
/* eslint-disable react/require-default-props, react/jsx-no-bind */
|
|
4
3
|
import { useEffect, useRef, useState } from 'react';
|
|
5
4
|
import { CSSTransition, TransitionGroup } from 'react-transition-group';
|
|
6
5
|
import styled, { css } from 'styled-components';
|
package/hooks/useAsyncFn.js
CHANGED
|
@@ -14,7 +14,6 @@ export default function useAsyncFn(fn, deps = [], initialState = getDefaultState
|
|
|
14
14
|
const callback = useCallback(({
|
|
15
15
|
reset
|
|
16
16
|
} = {}) => {
|
|
17
|
-
// eslint-disable-next-line no-plusplus
|
|
18
17
|
const callId = ++lastCallId.current;
|
|
19
18
|
const canSet = () => isMounted() && callId === lastCallId.current;
|
|
20
19
|
if (canSet()) {
|
|
@@ -14,7 +14,6 @@ export default function useAsyncFunction(fn) {
|
|
|
14
14
|
const isMounted = useMountedState();
|
|
15
15
|
const [state, setState] = useState(getDefaultState);
|
|
16
16
|
const execute = usePersistentFunction((...args) => {
|
|
17
|
-
// eslint-disable-next-line no-plusplus
|
|
18
17
|
const count = ++countRef.current;
|
|
19
18
|
const canSet = () => isMounted() && count === countRef.current;
|
|
20
19
|
if (canSet()) {
|
package/hooks/useClickAway.js
CHANGED
|
@@ -48,7 +48,6 @@ export function useClickAway(use, ref,
|
|
|
48
48
|
cb) {
|
|
49
49
|
// Persist the callback function to avoid re-subscribing on every render
|
|
50
50
|
const persistentCb = usePersistentFunction(cb);
|
|
51
|
-
// eslint-disable-next-line consistent-return
|
|
52
51
|
useEffect(() => {
|
|
53
52
|
// Only subscribe if the hook is active and the ref points to an element
|
|
54
53
|
if (use && ref.current) {
|
package/package.json
CHANGED
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/kit-helpers",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.5",
|
|
4
4
|
"description": "React component for build Pushwoosh products",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
7
7
|
"types": "index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"publishConfig": {
|
|
10
|
-
"access": "public"
|
|
10
|
+
"access": "public",
|
|
11
|
+
"directory": "dist"
|
|
11
12
|
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"start": "npm run playground",
|
|
14
|
-
"build": "pushwoosh-engine lib:build",
|
|
15
|
-
"playground": "pushwoosh-engine lib:playground",
|
|
16
|
-
"check": "npm run check:lint && npm run check:types",
|
|
17
|
-
"check:lint": "echo \"Run check:lint\" && NODE_ENV=production eslint ./src",
|
|
18
|
-
"check:lint-fix": "echo \"Run check:lint\" && NODE_ENV=production eslint ./src --fix",
|
|
19
|
-
"check:types": "echo \"Run check:types\" && pushwoosh-engine lib:check-types"
|
|
20
|
-
},
|
|
21
|
-
"pre-commit": "check",
|
|
22
13
|
"dependencies": {
|
|
23
14
|
"react-transition-group": "^4.4.5"
|
|
24
15
|
},
|
|
25
16
|
"devDependencies": {
|
|
26
|
-
"@pushwoosh/
|
|
27
|
-
"@
|
|
28
|
-
"@types/react": "^18.3.
|
|
29
|
-
"@types/react-dom": "^18.3.0",
|
|
17
|
+
"@pushwoosh/kit-constants": "^1.12.3",
|
|
18
|
+
"@types/react": "^18.3.31",
|
|
19
|
+
"@types/react-dom": "^18.3.7",
|
|
30
20
|
"@types/react-transition-group": "^4.4.10",
|
|
31
21
|
"@types/styled-components": "^5.1.34",
|
|
32
22
|
"@types/webpack-env": "^1.18.8",
|
|
33
|
-
"cross-env": "^7.0.3",
|
|
34
|
-
"pre-commit": "^1.2.2",
|
|
35
23
|
"react": "^18.3.1",
|
|
36
24
|
"react-dom": "^18.3.1",
|
|
37
25
|
"styled-components": "^5.3.11"
|
|
@@ -41,6 +29,15 @@
|
|
|
41
29
|
"styled-components": ">=5.3.3"
|
|
42
30
|
},
|
|
43
31
|
"engines": {
|
|
44
|
-
"node": ">=
|
|
32
|
+
"node": ">= 24"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"start": "pnpm run playground",
|
|
36
|
+
"build": "pushwoosh-engine lib:build",
|
|
37
|
+
"playground": "pushwoosh-engine lib:playground",
|
|
38
|
+
"check": "pnpm run check:lint && pnpm run check:types",
|
|
39
|
+
"check:lint": "echo \"Run check:lint\" && NODE_ENV=production eslint ./src",
|
|
40
|
+
"check:lint-fix": "echo \"Run check:lint\" && NODE_ENV=production eslint ./src --fix",
|
|
41
|
+
"check:types": "echo \"Run check:types\" && pushwoosh-engine lib:check-types"
|
|
45
42
|
}
|
|
46
|
-
}
|
|
43
|
+
}
|