syncthing-hooks/index.js
2020-03-18 20:01:47 +02:00

14 lines
282 B
JavaScript

const { fetchNewEvents } = require('./api');
require('dotenv').config();
const state = {};
setInterval(async () => {
const { events, seenIds } = await fetchNewEvents(state.seenIds);
state.seenIds = seenIds;
events.forEach(event => {
console.log(event);
});
}, 1000);