Skip to content

Commit 7efb9db

Browse files
committed
refactor: remove use of Object.assign
TS already transpiles spread to Object.assign with target:es2016
1 parent d121a9b commit 7efb9db

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

packages/reactivity/src/effect.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,10 @@ export function trackEffects(
237237
dep.add(activeEffect!)
238238
activeEffect!.deps.push(dep)
239239
if (__DEV__ && activeEffect!.onTrack) {
240-
activeEffect!.onTrack(
241-
Object.assign(
242-
{
243-
effect: activeEffect!
244-
},
245-
debuggerEventExtraInfo
246-
)
247-
)
240+
activeEffect!.onTrack({
241+
effect: activeEffect!,
242+
...debuggerEventExtraInfo!
243+
})
248244
}
249245
}
250246
}

packages/runtime-core/src/apiCreateApp.ts

-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ export function createAppAPI<HostElement>(
179179
hydrate?: RootHydrateFunction
180180
): CreateAppFunction<HostElement> {
181181
return function createApp(rootComponent, rootProps = null) {
182-
183182
if (!isFunction(rootComponent)) {
184183
rootComponent = { ...rootComponent }
185184
}

packages/runtime-core/src/apiWatch.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function watchPostEffect(
9292
effect,
9393
null,
9494
(__DEV__
95-
? Object.assign(options || {}, { flush: 'post' })
95+
? { ...options, flush: 'post' }
9696
: { flush: 'post' }) as WatchOptionsBase
9797
)
9898
}
@@ -105,7 +105,7 @@ export function watchSyncEffect(
105105
effect,
106106
null,
107107
(__DEV__
108-
? Object.assign(options || {}, { flush: 'sync' })
108+
? { ...options, flush: 'sync' }
109109
: { flush: 'sync' }) as WatchOptionsBase
110110
)
111111
}

0 commit comments

Comments
 (0)