Stats Collector Reference Source Repository

src/collectors/number/Range.js

  1. import Collector from '../Collector';
  2.  
  3. /**
  4. * A collector that captures `range`
  5. * - The range from the minimum to the maximum
  6. * range = max - min
  7. */
  8. export default class Range extends Collector {
  9. constructor() {
  10. super('range', 0, ['min', 'max']);
  11. }
  12. handleGet(state) {
  13. return state.max - state.min;
  14. }
  15. }