0.0.3 • Published 5 months ago
@lucasschirm/amb-client-react v0.0.3
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();
}, []);
}