@ombori/ga-messaging
TypeScript icon, indicating that this package has built-in type declarations

3.91.5 • Public • Published

GridApp Messaging

A module performing device-to-module communications for grid apps

Hooks

usePublish()

Returns a (type: string, payload: any) => void function, that could be used to broadcast messages to modules.

Example:

import {usePublish} from '@ombori/ga-messaging';

export default App = () => {
  const publish = usePublish();

  const handleClick = useCallback(() => {
    publish('Test.ping', {hello: 'world'});
  }, [publish])

  return <button onClick={handleClick}>pub</button>
}

useSubscribe(type: string, callback: (msg: any) => void, deps: any[]);

Subscribes to a certain message type.

useStatus(): boolean

Returns message bus connection status

useHeartbeat(): void

Sends heartbeats to GridOS, indicating that app is alive.

Readme

Keywords

none

Package Sidebar

Install

npm i @ombori/ga-messaging

Weekly Downloads

17

Version

3.91.5

License

UNLICENSED

Unpacked Size

41.8 kB

Total Files

13

Last publish

Collaborators

  • javapocalypse
  • gaboraszt
  • zahid-hsn
  • ilatif
  • ahmed.abdelfatah
  • rmalpass
  • jaombori
  • hassellof
  • omboriadmin
  • zhalo
  • findingsimo
  • oliviazhang
  • kamilplaczek-ombori
  • dim2k