@@ -10,6 +10,8 @@ import { globalModels as models } from './global-models'
10
10
import _get from 'lodash/get'
11
11
import _omit from 'lodash/omit'
12
12
import { isRef } from '@vue/composition-api'
13
+ import { ServiceState } from '..'
14
+ import { Id } from '@feathersjs/feathers'
13
15
14
16
const FILTERS = [ '$sort' , '$limit' , '$skip' , '$select' ]
15
17
const OPERATORS = [ '$in' , '$nin' , '$lt' , '$lte' , '$gt' , '$gte' , '$ne' , '$or' ]
@@ -114,6 +116,20 @@ export default function makeServiceGetters() {
114
116
115
117
return Model . copiesById [ id ]
116
118
}
117
- }
119
+ } ,
120
+
121
+ isCreatePendingById : ( { isIdCreatePending } : ServiceState ) => ( id : Id ) =>
122
+ isIdCreatePending . includes ( id ) ,
123
+ isUpdatePendingById : ( { isIdUpdatePending } : ServiceState ) => ( id : Id ) =>
124
+ isIdUpdatePending . includes ( id ) ,
125
+ isPatchPendingById : ( { isIdPatchPending } : ServiceState ) => ( id : Id ) =>
126
+ isIdPatchPending . includes ( id ) ,
127
+ isRemovePendingById : ( { isIdRemovePending } : ServiceState ) => ( id : Id ) =>
128
+ isIdRemovePending . includes ( id ) ,
129
+ isPendingById : ( state : ServiceState , getters ) => ( id : Id ) =>
130
+ getters . isCreatePendingById ( id ) ||
131
+ getters . isUpdatePendingById ( id ) ||
132
+ getters . isPatchPendingById ( id ) ||
133
+ getters . isRemovePendingById ( id )
118
134
}
119
135
}
0 commit comments