Skip to content

Commit e178b8d

Browse files
committed
refactor: add typings and lint
1 parent 31a72b1 commit e178b8d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/service-module/service-module.actions.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ eslint
55
*/
66
import fastCopy from 'fast-copy'
77
import { getId } from '../utils'
8+
import { Service } from '@feathersjs/feathers'
89

9-
export default function makeServiceActions(service) {
10+
export default function makeServiceActions(service: Service<any>) {
1011
const serviceActions = {
1112
find({ commit, dispatch }, params) {
1213
params = params || {}
@@ -261,8 +262,8 @@ export default function makeServiceActions(service) {
261262
const { idField, autoRemove } = state
262263

263264
list.forEach(item => {
264-
let id = getId(item, idField)
265-
let existingItem = state.keyedById[id]
265+
const id = getId(item, idField)
266+
const existingItem = state.keyedById[id]
266267

267268
if (id !== null && id !== undefined) {
268269
existingItem ? toUpdate.push(item) : toAdd.push(item)
@@ -305,8 +306,8 @@ export default function makeServiceActions(service) {
305306
*/
306307
async addOrUpdate({ state, commit }, item) {
307308
const { idField } = state
308-
let id = getId(item, idField)
309-
let existingItem = state.keyedById[id]
309+
const id = getId(item, idField)
310+
const existingItem = state.keyedById[id]
310311

311312
const isIdOk = id !== null && id !== undefined
312313

src/service-module/service-module.state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ eslint
66

77
import _omit from 'lodash/omit'
88

9-
import { MakeServicePluginOptions, PaginationState } from './types'
9+
import { MakeServicePluginOptions } from './types'
1010

1111
export interface ServiceStateExclusiveDefaults {
1212
ids: string[]

0 commit comments

Comments
 (0)