Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

throttle.js 424B

12345678910111213141516
  1. 'use strict'
  2. const throttle = require('p-throttle')
  3. const defaultProfile = require('./lib/default-profile')
  4. const withThrottling = (profile, limit = 5, interval = 1000) => {
  5. // https://github.com/public-transport/hafas-client/issues/76#issuecomment-574408717
  6. const {request} = {...defaultProfile, ...profile}
  7. return {
  8. ...profile,
  9. request: throttle({limit, interval})(request)
  10. }
  11. }
  12. module.exports = withThrottling