witnet / witnet-requests-js

Witnet Requests Javascript Library
MIT License
5 stars 11 forks source link

Provide pre-configured aggregation and tally functions #67

Closed aesedepece closed 2 years ago

aesedepece commented 2 years ago

From a UX point of view, instead of:

const aggregator = new Witnet.Aggregator({
  filters: [
    [Witnet.Types.FILTERS.deviationStandard, 1.5],
  ],
  reducer: Witnet.Types.REDUCERS.averageMean,
})

it would be super nice if we could simply do things like this:

const aggregator = Witnet.Aggregator.default()
const aggregator = Witnet.Aggregator.deviationAndAverage(1.5)
const aggregator = Witnet.Aggregator.mode()