emitrpc-incept
TypeScript icon, indicating that this package has built-in type declarations

0.0.26 • Public • Published

Emit RPC Incept JS Plugin

An Event RPC Incept plugin

Install

$ npm i emitrpc-incept

or

$ yarn add emitrpc-incept

Basics

In your package.json add emitrpc-incept like the following.

{
  "incept": [ "emitrpc-incept" ]
}

Next in a component use the hook useEmit() to call events remotely. There's no need to wrap this in useEffect().

import { useEmit } from 'emitrpc-react'

export default function About() {
  const response = useEmit('company-detail', { id: 1 })
  if (!response) {
    return <h1>Loading...</h1>
  }
  return <h1>About {response.results.name}</h1>
}

Resources

Readme

Keywords

none

Package Sidebar

Install

npm i emitrpc-incept

Weekly Downloads

0

Version

0.0.26

License

MIT

Unpacked Size

3.75 kB

Total Files

8

Last publish

Collaborators

  • cblanquera
  • inceptasia