handler-delay.js 322 B

12345678910111213141516
  1. import { getBlockConnection } from '../helper';
  2. function delay(block) {
  3. return new Promise((resolve) => {
  4. const delayTime = +block.data.time || 500;
  5. setTimeout(() => {
  6. resolve({
  7. data: '',
  8. nextBlockId: getBlockConnection(block),
  9. });
  10. }, delayTime);
  11. });
  12. }
  13. export default delay;