1.1.0 • Published 2 years ago
@nullrpc/client v1.1.0
@nullrpc/client
You probably shouldn't use this yet.
Usage
import {createRPCClient} from "./src";
// createRPCClient(endpoint, axiosConfig, retryDelays)
const client = createRPCClient(
"https://api.example/com/rpc",
{withCredentials: true},
[1000, 2000, 5000],
);
client.request("add", {a: 1, b: 2}).then((result) => {
// Result: any
console.log("Result: ", result);
}).catch((error) => {
// Error: {code: number, message: string, data?: any}
console.log("Error: ", error);
});