refactor(middleware/combine.ts): change exported function to 'function declaration' (#3030)

This commit is contained in:
Wonsuk Choi 2025-02-27 20:43:35 +09:00 committed by GitHub
parent bc60812e33
commit 8ced2719ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,17 +2,14 @@ import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.ts'
type Write<T, U> = Omit<T, keyof U> & U
type Combine = <
export function combine<
T extends object,
U extends object,
Mps extends [StoreMutatorIdentifier, unknown][] = [],
Mcs extends [StoreMutatorIdentifier, unknown][] = [],
>(
initialState: T,
additionalStateCreator: StateCreator<T, Mps, Mcs, U>,
) => StateCreator<Write<T, U>, Mps, Mcs>
export const combine: Combine =
(initialState, create) =>
(...a) =>
Object.assign({}, initialState, (create as any)(...a))
create: StateCreator<T, Mps, Mcs, U>,
): StateCreator<Write<T, U>, Mps, Mcs> {
return (...a) => Object.assign({}, initialState, (create as any)(...a))
}