@@ -3,20 +3,21 @@ import { ref, reactive, toRefs, onMounted, onUnmounted, unref, inject } from 'vu
3
3
import Fetch from './Fetch'
4
4
import { USEREQUEST_GLOBAL_OPTIONS_PROVIDE_KEY } from './config'
5
5
import { UseRequestOptions , UseRequestPlugin , useRequestResult , UseRequestService } from './types'
6
- import { merge } from 'lodash'
7
6
8
7
function useRequestImplement < TData , TParams extends any [ ] > (
9
8
service : UseRequestService < TData , TParams > ,
10
9
options : UseRequestOptions < TData , TParams , any > = { } ,
11
10
plugins : UseRequestPlugin < TData , TParams > [ ] = [ ] ,
12
11
) {
13
12
// global option
14
- const USEREQUEST_GLOBAL_OPTIONS = inject ( USEREQUEST_GLOBAL_OPTIONS_PROVIDE_KEY )
13
+ const USEREQUEST_GLOBAL_OPTIONS = inject < Record < string , any > > (
14
+ USEREQUEST_GLOBAL_OPTIONS_PROVIDE_KEY ,
15
+ )
15
16
// read option
16
- const { initialData = undefined , manual = false , ready = true , ...rest } = merge (
17
- USEREQUEST_GLOBAL_OPTIONS ,
18
- options ?? { } ,
19
- ) as Record < string , any >
17
+ const { initialData = undefined , manual = false , ready = true , ...rest } = {
18
+ ... ( USEREQUEST_GLOBAL_OPTIONS ?? { } ) ,
19
+ ... ( options ?? { } ) ,
20
+ } as Record < string , any >
20
21
21
22
const fetchOptions = {
22
23
manual,
0 commit comments