1.0.4 • Published 8 years ago
SimpleRPC v1.0.4
SimpleRPC
This is an implementation of a JsonRPC client in javascript (es7) for use with jspm.
##Example
import simplerpc from "lib/simplerpc" //import the lib
var api = simplerpc("ws://127.0.0.1:1234"); //connect to a JsonRPC server and get an object to act as the API
api.UpdateCurrentUsers = (num) => { //expose a method the server can call
document.querySelector("#currentusers").innerText = num;
}
var data = await api.SomeMethod("arg1", 2, 3); //call any method the server exposes and await its result
console.log(data);