UNPKG

@jahed/sparql-engine

Version:

SPARQL query engine for servers and web browsers.

19 lines (15 loc) 384 B
// SPDX-License-Identifier: MIT import { Consumable } from "./consumer.ts"; /** * A consumer that executes a simple action */ export default class ActionConsumer<T> extends Consumable<T> { private _action: () => void; constructor(action: () => void) { super(); this._action = action; } execute(): Promise<void> { return Promise.resolve(this._action()); } }