Skip to content

Commit

Permalink
renamed updateCache to update
Browse files Browse the repository at this point in the history
  • Loading branch information
Corepex committed Dec 10, 2024
1 parent 34cb230 commit 70cee4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/js/src/core/modules/element/hooks/use-cache-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { type ElementType } from '../../../../../types/element-type.d'
import { type Element } from '../element-helper'

interface UseCacheUpdateHookReturn {
updateCache: (props: UpdateCacheProps) => void
update: (props: UpdateCacheProps) => void
updateFieldValue: (id: number, field: string, value: any) => void
}

Expand Down Expand Up @@ -56,7 +56,7 @@ export const useCacheUpdate = (elementType: ElementType, tags: ReadonlyArray<Tag
throw new Error('Unknown element type')
}

const updateCache = ({ updateFn }: UpdateCacheProps): void => {
const update = ({ updateFn }: UpdateCacheProps): void => {
cacheEntries.forEach((cacheEntry) => {
// @ts-expect-error not compatible with the current type definitions
dispatch(api.util.updateQueryData(
Expand Down Expand Up @@ -88,7 +88,7 @@ export const useCacheUpdate = (elementType: ElementType, tags: ReadonlyArray<Tag
}

return {
updateCache,
update,
updateFieldValue
}
}

0 comments on commit 70cee4d

Please sign in to comment.