sm-rpc

call rpc services

Usage no npm install needed!

<script type="module">
  import smRpc from 'https://cdn.skypack.dev/sm-rpc';
</script>

README

Installation

npm install sm-rpc --save

Usage

es5

const rpc = require('sm-rpc');

es6 - es7

import rpc from 'sm-rpc';

async - await

let result = await rpc(ServiceName, 'Method', { param1: value, param2: value });

promise

rpc(ServiceName, 'Method', { param1: value, param2: value }).then(
    (data) => { console.log(data) },
    (error) => { console.log(error) }
);