*Use shorthand function

This commit is contained in:
Derrick Hammer 2022-08-28 13:09:47 -04:00
parent 187e2f8fdf
commit e7aedc9950
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 22 additions and 23 deletions

View File

@ -1,28 +1,27 @@
import type {Plugin, PluginAPI} from "@lumeweb/relay"; import type { Plugin, PluginAPI } from "@lumeweb/relay";
import {RPCResponse} from "@lumeweb/relay"; import { RPCResponse } from "@lumeweb/relay";
const plugin: Plugin = { const plugin: Plugin = {
name: "core", name: "core",
async plugin(api: PluginAPI): Promise<void> { async plugin(api: PluginAPI): Promise<void> {
api.registerMethod("ping", { api.registerMethod("ping", {
cacheable: false, cacheable: false,
handler: async (): Promise<RPCResponse | null> => { async handler(): Promise<RPCResponse | null> {
return { return {
data: "pong" data: "pong",
} };
} },
}) });
api.registerMethod("get_methods", { api.registerMethod("get_methods", {
cacheable: false, cacheable: false,
handler: async (): Promise<RPCResponse | null> => { async handler(): Promise<RPCResponse | null> {
return { return {
data: api.getMethods() data: api.getMethods(),
} };
} },
}) });
} },
};
}
export default plugin; export default plugin;