Skip to content

Commit a806f91

Browse files
authored
refactor(vanilla): change all exported functions to 'function declarations' (#1061)
1 parent 9b29b64 commit a806f91

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/vanilla.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -325,19 +325,21 @@ export function ref<T extends object>(obj: T) {
325325
// unstable APIs (subject to change without notice)
326326
// ------------------------------------------------
327327

328-
export const unstable_getInternalStates = (): {
328+
export function unstable_getInternalStates(): {
329329
proxyStateMap: typeof proxyStateMap
330330
refSet: typeof refSet
331331
snapCache: typeof snapCache
332332
versionHolder: typeof versionHolder
333333
proxyCache: typeof proxyCache
334-
} => ({
335-
proxyStateMap,
336-
refSet,
337-
snapCache,
338-
versionHolder,
339-
proxyCache,
340-
})
334+
} {
335+
return {
336+
proxyStateMap,
337+
refSet,
338+
snapCache,
339+
versionHolder,
340+
proxyCache,
341+
}
342+
}
341343

342344
export function unstable_replaceInternalFunction(
343345
name: 'objectIs',

src/vanilla/utils/deepClone.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ const getDefaultRefSet = (): WeakSet<object> => {
1111
return defaultRefSet
1212
}
1313

14-
export const deepClone = <T>(
14+
export function deepClone<T>(
1515
obj: T,
1616
getRefSet: () => WeakSet<object> = getDefaultRefSet,
17-
): T => {
17+
): T {
1818
if (!isObject(obj) || getRefSet().has(obj)) {
1919
return obj
2020
}

0 commit comments

Comments
 (0)