0.0.3 • Published 5 months ago

@lucasschirm/amb-client-react v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Simple package that allow you to use the servicenow AMB service on your react application.

Usage

To install run the command below on the react app folder

npm install @lucasschirm/amb-client-react

To use it on your react component just import and use it like the example below.

import useAMB, { encodeQuery } from "@lucasschirm/amb-client-react";

export default function MyComponent() {
  const amb = useAMB();

  useEffect(() => {
    const unsubscribe = amb.subscribe(
      "/rw/default/incident/" + encodeQuery("is_active=1"),
      (message) => {
        console.log(`Record changed: `, message);
      }
    );

    return () => unsubscribe();
  }, []);
}
0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago