Skip to content

Commit

Permalink
refactor(vanilla): change all exported functions to 'function declara…
Browse files Browse the repository at this point in the history
…tions'
  • Loading branch information
sukvvon committed Feb 26, 2025
1 parent 9b29b64 commit abcf52a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions src/vanilla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,19 +325,21 @@ export function ref<T extends object>(obj: T) {
// unstable APIs (subject to change without notice)
// ------------------------------------------------

export const unstable_getInternalStates = (): {
export function unstable_getInternalStates(): {
proxyStateMap: typeof proxyStateMap
refSet: typeof refSet
snapCache: typeof snapCache
versionHolder: typeof versionHolder
proxyCache: typeof proxyCache
} => ({
proxyStateMap,
refSet,
snapCache,
versionHolder,
proxyCache,
})
} {
return {
proxyStateMap,
refSet,
snapCache,
versionHolder,
proxyCache,
}
}

export function unstable_replaceInternalFunction(
name: 'objectIs',
Expand Down
4 changes: 2 additions & 2 deletions src/vanilla/utils/deepClone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const getDefaultRefSet = (): WeakSet<object> => {
return defaultRefSet
}

export const deepClone = <T>(
export function deepClone<T>(
obj: T,
getRefSet: () => WeakSet<object> = getDefaultRefSet,
): T => {
): T {
if (!isObject(obj) || getRefSet().has(obj)) {
return obj
}
Expand Down

0 comments on commit abcf52a

Please # to comment.