refactor: remove use of Object.assign

TS already transpiles spread to Object.assign with target:es2016
This commit is contained in:
Evan You 2022-04-12 15:22:11 +08:00
parent d121a9bc7e
commit 7efb9dba30
3 changed files with 6 additions and 11 deletions

View File

@ -237,14 +237,10 @@ export function trackEffects(
dep.add(activeEffect!)
activeEffect!.deps.push(dep)
if (__DEV__ && activeEffect!.onTrack) {
activeEffect!.onTrack(
Object.assign(
{
effect: activeEffect!
},
debuggerEventExtraInfo
)
)
activeEffect!.onTrack({
effect: activeEffect!,
...debuggerEventExtraInfo!
})
}
}
}

View File

@ -179,7 +179,6 @@ export function createAppAPI<HostElement>(
hydrate?: RootHydrateFunction
): CreateAppFunction<HostElement> {
return function createApp(rootComponent, rootProps = null) {
if (!isFunction(rootComponent)) {
rootComponent = { ...rootComponent }
}

View File

@ -92,7 +92,7 @@ export function watchPostEffect(
effect,
null,
(__DEV__
? Object.assign(options || {}, { flush: 'post' })
? { ...options, flush: 'post' }
: { flush: 'post' }) as WatchOptionsBase
)
}
@ -105,7 +105,7 @@ export function watchSyncEffect(
effect,
null,
(__DEV__
? Object.assign(options || {}, { flush: 'sync' })
? { ...options, flush: 'sync' }
: { flush: 'sync' }) as WatchOptionsBase
)
}