Skip to content

Commit bd273f8

Browse files
committed
fix: perf
1 parent eb4a0c2 commit bd273f8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,14 @@ type CheckOnce<X, S extends Specification> = $.If<
9191
type CheckEnabled<S extends Specification> = S[Options.Enabled]
9292

9393
type Checks<X, S extends Specification> =
94-
| CheckConflicts<X, S>
94+
// -
95+
| CheckOnce<X, S>
96+
// -
9597
| CheckDependencies<X, S>
98+
// -
99+
| CheckConflicts<X, S>
100+
// -
96101
| CheckEnabled<S>
97-
| CheckOnce<X, S>
98102

99103
type Check<T extends Model, S> = S extends Specification
100104
? T['log'] extends Array<{ type: infer X }>
@@ -111,15 +115,14 @@ export type Instance<S extends Settings, T extends Model> = Fluent<
111115
Check<T, $.Properties<$.Type<S[Options.Specification], T>>>
112116
>
113117

114-
type ReducerNextState<T extends Settings, U extends Action[]> = $.Properties<
115-
$.Type<T[Options.Reducer], U>,
116-
$.Values<U>['type'],
118+
type ReducerNextState<T extends Settings, U extends Action[]> = $.Cast<
119+
$.To.Intersection<$.Properties<$.Type<T[Options.Reducer], U>, $.Values<U>['type'], {}>>,
117120
{}
118121
>
119122

120123
export type Reducer<T extends Settings, U extends Action[]> = $.Assign<
121124
T[Options.InitialState],
122-
$.Cast<$.To.Intersection<ReducerNextState<T, U>>, {}>
125+
ReducerNextState<T, U>
123126
>
124127

125128
export interface Log<T extends Settings, U extends Action[]> {

0 commit comments

Comments
 (0)