syncthing-hooks/index.js

14 lines
282 B
JavaScript
Raw Normal View History

2020-03-17 22:11:02 +01:00
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);