New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@alexmerced/simplerpc-client

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alexmerced/simplerpc-client

`npm install @alexmerced/simplerpc-client`

latest
Source
npmnpm
Version
1.1.41
Version published
Weekly downloads
15
275%
Maintainers
1
Weekly downloads
 
Created
Source

SimpleRPC - Client

npm install @alexmerced/simplerpc-client

The SimpleRPC framework is a framework for creating very simple lightweight RPC APIs for use with any backend or frontend framework with a redux/useReducer like API.

Actions take the signature of

(payload: Object, context: Object) => response:Any

The client function then can be called like so:

rpcDispatch({type: "actionName", payload: {arg1: 1, arg 2: "hello"}})

Setting up the Client

import {createClient} from "simplerpc-client"

const rpcDispatch = createClient({
    url: "http://localhost:4000/rpc",
    headers: {
        "authorization": "..."
    }
})

export default rpcDispatch

Then assuming your server is setup with @alexmerced/simplerpc-server at the specific endpoint you can make rpc calls like so.

await rpcDispatch({type: "createTodo", payload: {
    message: "Lunch"
}})

FAQs

Package last updated on 02 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts