@@ -7,16 +7,21 @@ import makeDefaultState from './service-module.state'
7
7
import makeGetters from './service-module.getters'
8
8
import makeMutations from './service-module.mutations'
9
9
import makeActions from './service-module.actions'
10
+ import { Service } from '@feathersjs/feathers'
11
+ import { MakeServicePluginOptions } from './types'
10
12
11
- export default function makeServiceModule ( service , options ) {
12
- const defaultState = makeDefaultState ( options . servicePath , options )
13
+ export default function makeServiceModule (
14
+ service : Service < any > ,
15
+ options : MakeServicePluginOptions
16
+ ) {
17
+ const defaultState = makeDefaultState ( options )
13
18
const defaultGetters = makeGetters ( )
14
19
const defaultMutations = makeMutations ( )
15
20
const defaultActions = makeActions ( service )
16
21
17
22
return {
18
23
namespaced : true ,
19
- state : Object . assign ( defaultState , options . state ) ,
24
+ state : Object . assign ( { } , defaultState , options . state ) ,
20
25
getters : Object . assign ( { } , defaultGetters , options . getters ) ,
21
26
mutations : Object . assign ( { } , defaultMutations , options . mutations ) ,
22
27
actions : Object . assign ( { } , defaultActions , options . actions )
0 commit comments