Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 537 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 537 Bytes

data-collector

Collects data from a datasource on interval

Example:

const DataCollector = require('redningsselskapet/data-collector')

myDataCollector = DataCollector({
  fetchDataFunc: () => Promise.resolve('data'),
  interval: 2000,
  name: 'test-collector',
  workerFunc: data => console.log('work done on data')
})



myDataCollector.start() // start collecting
myDataCollector.stop() // stop collecting
myDataCollector.isRunning() // return true | false
myDataCollector.name() // returns name + unique id