@reactuses/core 5.0.9 → 5.0.11
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/dist/index.cjs +8 -4
- package/dist/index.d.cts +12 -12
- package/dist/index.d.mts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.mjs +8 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2217,11 +2217,11 @@ const createOnceEffect = (hook)=>(effect, deps)=>{
|
|
|
2217
2217
|
const shouldStart = !record.has(effect);
|
|
2218
2218
|
if (shouldStart) {
|
|
2219
2219
|
record.add(effect);
|
|
2220
|
-
effect();
|
|
2220
|
+
return effect();
|
|
2221
2221
|
}
|
|
2222
2222
|
};
|
|
2223
2223
|
hook(()=>{
|
|
2224
|
-
onceWrapper();
|
|
2224
|
+
return onceWrapper();
|
|
2225
2225
|
}, deps);
|
|
2226
2226
|
};
|
|
2227
2227
|
|
|
@@ -3232,10 +3232,14 @@ const usePlatform = ({ userAgent } = {
|
|
|
3232
3232
|
]);
|
|
3233
3233
|
const isInWechat = React.useCallback(()=>{
|
|
3234
3234
|
return /micromessenger/i.test(ua);
|
|
3235
|
-
}, [
|
|
3235
|
+
}, [
|
|
3236
|
+
ua
|
|
3237
|
+
]);
|
|
3236
3238
|
const isiPhoneX = React.useCallback(()=>{
|
|
3237
3239
|
return /iPhoneX/i.test(ua);
|
|
3238
|
-
}, [
|
|
3240
|
+
}, [
|
|
3241
|
+
ua
|
|
3242
|
+
]);
|
|
3239
3243
|
return {
|
|
3240
3244
|
platform,
|
|
3241
3245
|
isInMiniProgram,
|
package/dist/index.d.cts
CHANGED
|
@@ -2589,24 +2589,24 @@ type UsePlatform = (props?: UsePlatformProps) => UsePlatformReturn;
|
|
|
2589
2589
|
*/
|
|
2590
2590
|
interface UsePlatformReturn {
|
|
2591
2591
|
/**
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2592
|
+
* @zh 平台
|
|
2593
|
+
* @en platform
|
|
2594
|
+
*/
|
|
2595
2595
|
platform: Platform;
|
|
2596
2596
|
/**
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2597
|
+
* @zh 是否在小程序中
|
|
2598
|
+
* @en Whether in mini program
|
|
2599
|
+
*/
|
|
2600
2600
|
isInMiniProgram: () => boolean;
|
|
2601
2601
|
/**
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2602
|
+
* @zh 是否在微信中
|
|
2603
|
+
* @en whether in wechat
|
|
2604
|
+
*/
|
|
2605
2605
|
isInWechat: () => boolean;
|
|
2606
2606
|
/**
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2607
|
+
* @zh 是否是 iPhoneX
|
|
2608
|
+
* @en whether is iPhoneX
|
|
2609
|
+
*/
|
|
2610
2610
|
isiPhoneX: () => boolean;
|
|
2611
2611
|
}
|
|
2612
2612
|
|
package/dist/index.d.mts
CHANGED
|
@@ -2589,24 +2589,24 @@ type UsePlatform = (props?: UsePlatformProps) => UsePlatformReturn;
|
|
|
2589
2589
|
*/
|
|
2590
2590
|
interface UsePlatformReturn {
|
|
2591
2591
|
/**
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2592
|
+
* @zh 平台
|
|
2593
|
+
* @en platform
|
|
2594
|
+
*/
|
|
2595
2595
|
platform: Platform;
|
|
2596
2596
|
/**
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2597
|
+
* @zh 是否在小程序中
|
|
2598
|
+
* @en Whether in mini program
|
|
2599
|
+
*/
|
|
2600
2600
|
isInMiniProgram: () => boolean;
|
|
2601
2601
|
/**
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2602
|
+
* @zh 是否在微信中
|
|
2603
|
+
* @en whether in wechat
|
|
2604
|
+
*/
|
|
2605
2605
|
isInWechat: () => boolean;
|
|
2606
2606
|
/**
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2607
|
+
* @zh 是否是 iPhoneX
|
|
2608
|
+
* @en whether is iPhoneX
|
|
2609
|
+
*/
|
|
2610
2610
|
isiPhoneX: () => boolean;
|
|
2611
2611
|
}
|
|
2612
2612
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2589,24 +2589,24 @@ type UsePlatform = (props?: UsePlatformProps) => UsePlatformReturn;
|
|
|
2589
2589
|
*/
|
|
2590
2590
|
interface UsePlatformReturn {
|
|
2591
2591
|
/**
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2592
|
+
* @zh 平台
|
|
2593
|
+
* @en platform
|
|
2594
|
+
*/
|
|
2595
2595
|
platform: Platform;
|
|
2596
2596
|
/**
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2597
|
+
* @zh 是否在小程序中
|
|
2598
|
+
* @en Whether in mini program
|
|
2599
|
+
*/
|
|
2600
2600
|
isInMiniProgram: () => boolean;
|
|
2601
2601
|
/**
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2602
|
+
* @zh 是否在微信中
|
|
2603
|
+
* @en whether in wechat
|
|
2604
|
+
*/
|
|
2605
2605
|
isInWechat: () => boolean;
|
|
2606
2606
|
/**
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2607
|
+
* @zh 是否是 iPhoneX
|
|
2608
|
+
* @en whether is iPhoneX
|
|
2609
|
+
*/
|
|
2610
2610
|
isiPhoneX: () => boolean;
|
|
2611
2611
|
}
|
|
2612
2612
|
|
package/dist/index.mjs
CHANGED
|
@@ -2210,11 +2210,11 @@ const createOnceEffect = (hook)=>(effect, deps)=>{
|
|
|
2210
2210
|
const shouldStart = !record.has(effect);
|
|
2211
2211
|
if (shouldStart) {
|
|
2212
2212
|
record.add(effect);
|
|
2213
|
-
effect();
|
|
2213
|
+
return effect();
|
|
2214
2214
|
}
|
|
2215
2215
|
};
|
|
2216
2216
|
hook(()=>{
|
|
2217
|
-
onceWrapper();
|
|
2217
|
+
return onceWrapper();
|
|
2218
2218
|
}, deps);
|
|
2219
2219
|
};
|
|
2220
2220
|
|
|
@@ -3225,10 +3225,14 @@ const usePlatform = ({ userAgent } = {
|
|
|
3225
3225
|
]);
|
|
3226
3226
|
const isInWechat = useCallback(()=>{
|
|
3227
3227
|
return /micromessenger/i.test(ua);
|
|
3228
|
-
}, [
|
|
3228
|
+
}, [
|
|
3229
|
+
ua
|
|
3230
|
+
]);
|
|
3229
3231
|
const isiPhoneX = useCallback(()=>{
|
|
3230
3232
|
return /iPhoneX/i.test(ua);
|
|
3231
|
-
}, [
|
|
3233
|
+
}, [
|
|
3234
|
+
ua
|
|
3235
|
+
]);
|
|
3232
3236
|
return {
|
|
3233
3237
|
platform,
|
|
3234
3238
|
isInMiniProgram,
|