This commit is contained in:
Jacob Nguyen
2024-05-04 12:24:22 -05:00
parent f762033504
commit 08ef80522f
4 changed files with 11 additions and 18 deletions

View File

@@ -1,5 +1,4 @@
import path from 'node:path';
import assert from 'assert';
import { existsSync } from 'fs';

View File

@@ -18,7 +18,6 @@ import {
import type { Emitter, ErrorHandling, Logging } from './interfaces';
import util from 'node:util';
import type { PluginResult } from '../types/core-plugin';
import type { Result } from 'ts-results-es'
import type { VoidResult } from './_internal';
/**
* if {src} is true, mapTo V, else ignore
@@ -70,12 +69,12 @@ export function handleError<C>(crashHandler: ErrorHandling, emitter: Emitter, lo
return caught;
};
}
// Temporary until i get rxjs operators working on ts-results-es
export const filterTap = <K, R>(onErr: (e: R) => void): OperatorFunction<Result<K, R>, K> =>
pipe(concatMap(result => {
if(result.isOk()) {
return of(result.value)
}
onErr(result.error);
return EMPTY
}))
//// Temporary until i get rxjs operators working on ts-results-es
//const filterTap = <K, R>(onErr: (e: R) => void): OperatorFunction<Result<K, R>, K> =>
// pipe(concatMap(result => {
// if(result.isOk()) {
// return of(result.value)
// }
// onErr(result.error);
// return EMPTY
// }))

View File

@@ -20,11 +20,7 @@ const parseConfig = async (conf: Promise<PresenceResult>) => {
return of(s).pipe(take(1));
})
};
interface PresenceModule {
module: PresenceConfig<(keyof Dependencies)[]>
}
export const presenceHandler = (path: string, setPresence: SetPresence) => {
// const presence = Files
// .importModule<PresenceModule>(path)
// .then(({ module }) => {
@@ -40,4 +36,4 @@ export const presenceHandler = (path: string, setPresence: SetPresence) => {
// concatMap(fn => parseConfig(fn())),
// // subscribe to the observable parseConfig yields, and set the presence.
// concatMap(conf => conf.pipe(map(setPresence))));
}

View File

@@ -2,7 +2,6 @@ import callsites from 'callsites';
import * as Files from './core/module-loading';
import { Services } from './core/ioc';
import type { DependencyList } from './types/ioc';
interface Wrapper {
commands?: string;
defaultPrefix?: string;