1
1
import { defineProperty , forEach , objectKeys } from '@/helper' ;
2
2
import { symbolToStringTag , undefinedValue } from '@/helper/variables' ;
3
3
import { AlovaCompleteEvent , Method } from 'alova' ;
4
- import { SilentMethod , SQHookBehavior } from '~/typings/general' ;
4
+ import { SQHookBehavior , SilentMethod } from '~/typings/general' ;
5
5
6
6
/**
7
7
* 创建统一的事件对象,它将承载以下事件
@@ -24,8 +24,23 @@ import { SilentMethod, SQHookBehavior } from '~/typings/general';
24
24
* [RetriableRetryEvent]重试:method实例、sendArgs、retryTimes、retryDelay
25
25
* [RetriableFailEvent]重试:method实例、sendArgs、错误对象、retryTimes
26
26
*/
27
+
28
+ export const enum AlovaHookEventType {
29
+ GlobalSQEvent = 0 ,
30
+ GlobalSQSuccessEvent = 1 ,
31
+ GlobalSQErrorEvent = 2 ,
32
+ GlobalSQFailEvent = 3 ,
33
+ ScopedSQEvent = 4 ,
34
+ ScopedSQSuccessEvent = 5 ,
35
+ ScopedSQErrorEvent = 6 ,
36
+ ScopedSQCompleteEvent = 7 ,
37
+ ScopedSQRetryEvent = 8 ,
38
+ RetriableRetryEvent = 9 ,
39
+ RetriableFailEvent = 10
40
+ }
41
+
27
42
export default < S , E , R , T , RC , RE , RH > (
28
- eventType : number ,
43
+ eventType : AlovaHookEventType ,
29
44
method : Method < S , E , R , T , RC , RE , RH > ,
30
45
behavior ?: SQHookBehavior ,
31
46
silentMethod ?: SilentMethod < S , E , R , T , RC , RE , RH > ,
0 commit comments