mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add check that runManySync actually doesn't have promises
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
fe9f585b71
commit
55db60abba
@ -19,7 +19,7 @@ type RunSync<Param> = (parameter: Param) => void;
|
|||||||
export type RunManySync = <Param>(injectionToken: InjectionToken<RunnableSync<Param>, void>) => RunSync<Param>;
|
export type RunManySync = <Param>(injectionToken: InjectionToken<RunnableSync<Param>, void>) => RunSync<Param>;
|
||||||
|
|
||||||
function runCompositeRunnableSyncs<Param>(param: Param, composite: Composite<RunnableSync<Param>>) {
|
function runCompositeRunnableSyncs<Param>(param: Param, composite: Composite<RunnableSync<Param>>) {
|
||||||
assert(!((composite.value.run(param) as any) instanceof Promise), "Cannot be an async function for runnable sync");
|
assert(!((composite.value.run(param) as unknown) instanceof Promise), `Cannot be an async function for runnable sync`);
|
||||||
composite.children.map(composite => runCompositeRunnableSyncs(param, composite));
|
composite.children.map(composite => runCompositeRunnableSyncs(param, composite));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user