Skip to content

Commit ae9a0eb

Browse files
committed
style: lodash isfunction refactor
1 parent 198d20c commit ae9a0eb

File tree

1 file changed

+2
-0
lines changed
  • packages/hooks/src/useCookieState

1 file changed

+2
-0
lines changed

packages/hooks/src/useCookieState/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function useCookieState(cookieKey: string, options: UseCookieStateOptions = {})
1515
if (typeof cookieValue === 'string') return cookieValue
1616

1717
if (isFunction(options.defaultValue)) {
18+
// @ts-ignore
1819
return options.defaultValue()
1920
}
2021
return options.defaultValue
@@ -28,6 +29,7 @@ function useCookieState(cookieKey: string, options: UseCookieStateOptions = {})
2829
// eslint-disable-next-line no-unused-vars
2930
const { defaultValue, ...restOptions } = { ...options, ...newOptions }
3031
const getValue = () => {
32+
// @ts-ignore
3133
const value = isFunction(newValue) ? newValue(state.value) : newValue
3234
if (value === undefined) {
3335
Cookies.remove(cookieKey)

0 commit comments

Comments
 (0)