0.0.3 • Published 1 year ago

@lucasschirm/amb-client-react v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year 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

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago