Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
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.

pause.asynct.js 944B

123456789101112131415161718192021222324252627282930313233343536373839
  1. var es = require('../')
  2. , it = require('it-is')
  3. , d = require('ubelt')
  4. exports ['gate buffers when shut'] = function (test) {
  5. var hundy = d.map(1,100, d.id)
  6. , gate = es.pause()
  7. , ten = 10
  8. es.connect(
  9. es.readArray(hundy),
  10. es.log('after readArray'),
  11. gate,
  12. //es.log('after gate'),
  13. es.map(function (num, next) {
  14. //stick a map in here to check that gate never emits when open
  15. it(gate.paused).equal(false)
  16. console.log('data', num)
  17. if(!--ten) {
  18. console.log('PAUSE')
  19. gate.pause()//.resume()
  20. d.delay(gate.resume.bind(gate), 10)()
  21. ten = 10
  22. }
  23. next(null, num)
  24. }),
  25. es.writeArray(function (err, array) { //just realized that I should remove the error param. errors will be emitted
  26. console.log('eonuhoenuoecbulc')
  27. it(array).deepEqual(hundy)
  28. test.done()
  29. })
  30. )
  31. gate.resume()
  32. }
  33. require('./helper')(module)