mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Implement empty canHandle on base class. (#289)
This commit is contained in:
@@ -9,7 +9,10 @@ export abstract class AsyncHandler<TInput, TOutput = void> {
|
||||
*
|
||||
* @returns A promise resolving if this input can be handled, rejecting with an Error if not.
|
||||
*/
|
||||
public abstract canHandle(input: TInput): Promise<void>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public async canHandle(input: TInput): Promise<void> {
|
||||
// Support any input by default
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the given input. This should only be done if the {@link canHandle} function returned `true`.
|
||||
|
||||
Reference in New Issue
Block a user