ksdjkldsfld

This commit is contained in:
Jacob Nguyen
2024-05-16 00:21:29 -05:00
parent 203e8c8ecf
commit 44c072f401
10 changed files with 70 additions and 68 deletions

View File

@@ -35,14 +35,12 @@ interface PluginExecutable {
* Calls any plugin with {args}.
* @param args if an array, its spread and plugin called.
*/
export function callPlugin(args: unknown): OperatorFunction<PluginExecutable, VoidResult>
export function callPlugin(plugin: PluginExecutable, args: unknown)
{
return concatMap(async plugin => {
if (Array.isArray(args)) {
return plugin.execute(...args);
}
return plugin.execute(args);
});
if (Array.isArray(args)) {
return plugin.execute(...args);
}
return plugin.execute(args);
}
export const arrayifySource = <T>(src: T) =>
@@ -52,7 +50,7 @@ export const arrayifySource = <T>(src: T) =>
* Checks if the stream of results is all ok.
*/
export const everyPluginOk: OperatorFunction<VoidResult, boolean> =
pipe(every(result => result.isOk()),
pipe(every(result => result.isOk()), //this shortcircuits
defaultIfEmpty(true));
export const sharedEventStream = <T>(e: Emitter, eventName: string) =>