Skip to content

Commit

Permalink
Fix condition types
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrHoroshih committed Nov 18, 2023
1 parent e07af37 commit b4bac9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/condition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
sample,
is,
Store,
Unit,
UnitTargetable,
split,
EventCallable,
} from 'effector';

type NoInfer<T> = T & { [K in keyof T]: T[K] };
Expand Down Expand Up @@ -70,15 +70,15 @@ export function condition<State>(options: {
if: ((payload: State) => boolean) | Store<boolean> | State;
then: UnitTargetable<NoInfer<State> | void>;
else: UnitTargetable<NoInfer<State> | void>;
}): EventAsReturnType<State>;
}): EventCallable<State>;
export function condition<State>(options: {
if: ((payload: State) => boolean) | Store<boolean> | State;
then: UnitTargetable<NoInfer<State> | void>;
}): Event<State>;
}): EventCallable<State>;
export function condition<State>(options: {
if: ((payload: State) => boolean) | Store<boolean> | State;
else: UnitTargetable<NoInfer<State> | void>;
}): Event<State>;
}): EventCallable<State>;
export function condition<State>({
if: test,
then: thenBranch,
Expand Down

0 comments on commit b4bac9d

Please sign in to comment.