We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6937ba4 commit 4944696Copy full SHA for 4944696
denops_std/anonymous/mod.ts
@@ -16,7 +16,7 @@ export type Identifier = string;
16
/**
17
* Anonymous function callback
18
*/
19
-export type Callback = (...args: unknown[]) => Promise<unknown>;
+export type Callback = (...args: unknown[]) => Promise<unknown> | unknown;
20
21
22
* Add anonymous functions as a denops API and return the identifiers
@@ -27,7 +27,9 @@ export function add<N extends number>(
27
): TupleOf<Identifier, N> {
28
return callbacks.map((callback) => {
29
const id = makeid();
30
- denops.dispatcher[id] = callback;
+ denops.dispatcher[id] = async (...args: unknown[]) => {
31
+ return await callback(...args);
32
+ };
33
return id;
34
// deno-lint-ignore no-explicit-any
35
}) as any;
0 commit comments