Title: 阿里异步串行编程题:按照以下要求,实现 createFlow 函数 · Issue #106 · sisterAn/JavaScript-Algorithms · GitHub
Open Graph Title: 阿里异步串行编程题:按照以下要求,实现 createFlow 函数 · Issue #106 · sisterAn/JavaScript-Algorithms
X Title: 阿里异步串行编程题:按照以下要求,实现 createFlow 函数 · Issue #106 · sisterAn/JavaScript-Algorithms
Description: const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); const subFlow = createFlow([() => delay(1000).then(() => console.log("c"))]); createFlow([ () => console.log("a"), () => console.log("b"), subFlow, [() => delay(100...
Open Graph Description: const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); const subFlow = createFlow([() => delay(1000).then(() => console.log("c"))]); createFlow([ () => console.log("a"), () => con...
X Description: const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); const subFlow = createFlow([() => delay(1000).then(() => console.log("c"))]); createFlow([ () => co...
Opengraph URL: https://github.com/sisterAn/JavaScript-Algorithms/issues/106
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"阿里异步串行编程题:按照以下要求,实现 createFlow 函数","articleBody":"```js\r\nconst delay = (ms) =\u003e new Promise((resolve) =\u003e setTimeout(resolve, ms));\r\n\r\nconst subFlow = createFlow([() =\u003e delay(1000).then(() =\u003e console.log(\"c\"))]);\r\n\r\ncreateFlow([\r\n () =\u003e console.log(\"a\"),\r\n () =\u003e console.log(\"b\"),\r\n subFlow,\r\n [() =\u003e delay(1000).then(() =\u003e console.log(\"d\")), () =\u003e console.log(\"e\")],\r\n]).run(() =\u003e {\r\n console.log(\"done\");\r\n});\r\n\r\n// 需要按照 a,b,延迟1秒,c,延迟1秒,d,e, done 的顺序打印\r\n```\r\n\r\n按照上面的测试用例,实现 `createFlow`:\r\n\r\n- `flow` 是指一系列 `effects` 组成的逻辑片段。\r\n- `flow` 支持嵌套。\r\n- `effects` 的执行只需要支持串行。","author":{"url":"https://github.com/sisterAn","@type":"Person","name":"sisterAn"},"datePublished":"2020-09-09T23:27:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/106/JavaScript-Algorithms/issues/106"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:20cc13f0-9b26-7079-5868-930765ea05a8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 900A:2706BA:1AC7C0:238813:696B34EF |
| html-safe-nonce | 946956fe259ce053070138d0a0dda1e3fcf21dfaeb1fd4c0175cd34cbc757a5c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDBBOjI3MDZCQToxQUM3QzA6MjM4ODEzOjY5NkIzNEVGIiwidmlzaXRvcl9pZCI6IjcxMjEzNTA5ODc1NTY1ODk5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5adabd54f10f8314681fe229bf2d11ee6d9cf580ba1cdb23690a2b721d5d648f |
| hovercard-subject-tag | issue:697233879 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sisterAn/JavaScript-Algorithms/106/issue_layout |
| twitter:image | https://opengraph.githubassets.com/11aa0cd1427b34a16dae5505ca6a2f722c8e47e17b7c9e6e7a961fcb3d03bd01/sisterAn/JavaScript-Algorithms/issues/106 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/11aa0cd1427b34a16dae5505ca6a2f722c8e47e17b7c9e6e7a961fcb3d03bd01/sisterAn/JavaScript-Algorithms/issues/106 |
| og:image:alt | const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); const subFlow = createFlow([() => delay(1000).then(() => console.log("c"))]); createFlow([ () => console.log("a"), () => con... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sisterAn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/sisterAn/JavaScript-Algorithms git https://github.com/sisterAn/JavaScript-Algorithms.git |
| octolytics-dimension-user_id | 19721451 |
| octolytics-dimension-user_login | sisterAn |
| octolytics-dimension-repository_id | 252061924 |
| octolytics-dimension-repository_nwo | sisterAn/JavaScript-Algorithms |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 252061924 |
| octolytics-dimension-repository_network_root_nwo | sisterAn/JavaScript-Algorithms |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width