feat: improve store and model typing
This commit is contained in:
parent
c9e85cb52b
commit
3766b5e51b
98 changed files with 1050 additions and 507 deletions
|
|
@ -1,8 +1,8 @@
|
|||
export function findIndexById(array : [], id : string | number) {
|
||||
export function findIndexById<T extends {id: string | number}>(array : T[], id : string | number) {
|
||||
return array.findIndex(({id: currentId}) => currentId === id)
|
||||
}
|
||||
|
||||
export function findById(array : [], id : string | number) {
|
||||
export function findById<T extends {id: string | number}>(array : T[], id : string | number) {
|
||||
return array.find(({id: currentId}) => currentId === id)
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue