hermeslib
1.0.27 • Public • Published
- Library for polling Hermes messages.
npm install hermeslib
or
yarn add hermeslib
import React from "react";
import "react-notifications/lib/notifications.css";
import { Cron } from "hermeslib";
function App() {
return (
<div>
<Cron
endpoint="https://localhost:8080/poll/{recipient}"
cronTime="0/30 * * * * *" //Run every 30 seconds
defaultNotification
callback={(err, data) =>
console.log(`error: ${err}, data: ${data}`)
}
/>
</div>
);
}
export default App;
Name |
Type |
Required |
Default |
Description |
endpoint |
string |
true |
- |
Endpoint to poll messages |
cronTime |
string |
false |
* * * * * |
Cron time string format (https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) |
callback |
function |
false |
- |
Function that will be called after receiving a message. (error : boolean, data : object) |
defaultNotification |
boolean |
false |
false |
Displays the default notifications imbedded in the library |
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads