-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
5 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn npm-run-all pretty:quick lint:staged | ||
npx npm-run-all pretty:quick lint:staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
|
||
const delay = require('./delay'); | ||
|
||
module.exports = async function (job) { | ||
let step = job.data.step; | ||
while (step !== 'FINISH') { | ||
switch (step) { | ||
case 'INITIAL': { | ||
await delay(200); | ||
const data = { | ||
...job.data, | ||
step: 'SECOND', | ||
extraDataSecondStep: 'second data', | ||
}; | ||
await job.updateData(data); | ||
step = 'SECOND'; | ||
break; | ||
} | ||
case 'SECOND': { | ||
await delay(200); | ||
const data = { | ||
...job.data, | ||
extraDataFinishedStep: 'finish data', | ||
step: 'FINISH', | ||
}; | ||
|
||
await job.updateData(data); | ||
step = 'FINISH'; | ||
return; | ||
} | ||
default: { | ||
throw new Error('invalid step'); | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters