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