Comments (12)
章、セクション
セクションって言葉は途中から使い始めた気がする。
どこかで混ざってそう
from promises-book.
事、こと
結構混ざってる感あるというか、IME的に統一して書くの難しい
from promises-book.
FulFilled または Rejected
Promiseコンストラクタで(executor functionである)resolveが呼ばれた -> (promiseオブジェクトが)Fulfilledとなった -> onFulfilledが呼ばれる
という対象が途中で変わってる所にあるから、最初の説明にこの流れ自体をちゃんと書いてあげるのがいいと思う。
from promises-book.
主語がPromiseの場合はresolve
and reject
(Promiseがresolveした時)
主語がpromiseオブジェクトの場合はFulfilled
and Rejected
.
(promiseオブジェクトがFulfilledとなった時)
後、resolve
(解決) と reject
(棄却)としてるけど、
素直に成功と失敗に統一した方が直感的な気がする。
from promises-book.
resolve,reject / FulFilled,Rejected の表現
方針を決めたのでメモる(CONTRIBUTE.mdに入れておくべきかな)
resolve と reject の注釈
- それぞれの用語の日本語の対応は resolve = 成功時 、 reject = 失敗時 とする。
- resolveした時 ≠ 解決した時 としない(解決という言葉紛らわしいので避けるべき)
promiseオブジェクトが主語の場合
- "promiseオブジェクトがFulFilled または Rejectedとなった時" と表記する
- 必ず大文字で FulFilled とする
resolve,reject / FulFilled,Rejected の使い分け
- "処理が成功した時" or "処理が失敗した時" という表現を使う場合、曖昧さが残らないように気をつける
- 例えば、"処理が成功した場合は
onFulfilled
が呼ばれますが" というようにその結果についても触れる
- 例えば、"処理が成功した場合は
new Promise
の処理について述べるなら、"resolveした時" と書いてもよい。- "resolveされた時" とは書かない
then
でのメソッドチェーン等、new Promise
と直接関係ないケースの場合にはFulFilled,Rejectedを使う
例) Promise.race
は、promiseオブジェクトがどれか一つでもFulFilled または Rejectedになったら次の処理を実行します。
from promises-book.
https://github.com/azu/promises-book/blob/master/CONTRIBUTE.md
に表現についてを追加した。
from promises-book.
利用者、ユーザー
利用者 - ライブラリの利用者という感じで使う。
ユーザーよりも利用者の方がイメージがつきやすいので、利用者を優先する
from promises-book.
(promiseオブジェクトが)resolveされる
は意味的には一応間違ってはないけど、
日本語的にはこっちのほうが使いやすくて面倒だなー
resolveされた -> その結果 -> promiseオブジェクトのstateがFulFilledとなる
Promise.all
は、stateがFulFilledとなったのがキーとして反応するから、resolveされた時というのは多分違う。
けど、resolveされた時という表現自体は間違いではなくて、仕様でもそういう表現出てくる。
A promise is resolved if it is settled or if it has been "locked in" match the state of another promise.
https://github.com/domenic/promises-unwrapping#promise-objects
なので、resolveされたという表現は積極的ではないけど、使っても問題はない感じ。
from promises-book.
コミットメッセージについて特に何も決めてなかったけど、
conventional-changelog/CONVENTIONS.md at master · ajoslin/conventional-changelog のルールに大体したがって書いている。
write()
という独自の記号を増やしてるけど…
ajoslin/conventional-changelog ベースのCHANGELOGを自動生成するために使ってるようなものなので、CHANGELOGに入れたほうがいいようなコミットはchore
ではなくてfix
を使ったほうがいいとかそれぐらいのイメージでやってる。
feat
, write
, fix
, docs
がたしかCHANGELOGにでるコミットの対象
from promises-book.
https://github.com/azu/promises-book/blob/master/CONTRIBUTE.md
にコミットメッセージを追加した
from promises-book.
Asciidoctor に依存した書き方を使っていい事を追記した
from promises-book.
https://github.com/azu/textlint-plugin-asciidoc-loose と textlintを使って簡単にはチェックしてる
from promises-book.
Related Issues (20)
- Node.jsのutil.promisifyについてを追加する HOT 1
- オフライン対応
- getURLのresolveを2xx全体を扱うように変更する HOT 2
- 1.xのアーカイブページの作成
- assertのPromiseサポート HOT 1
- Arrow Functionについての解説も追加
- v1のアーカイブリンク
- Deferredをclass化
- Promise.allSettled (ES2020)
- promise-funへのリンク
- Promise.any(ES2021) HOT 2
- typo reoslve -> resolve
- Unhandled RejectionとNode.jsの挙動 HOT 2
- copyOwnFromとTimeoutErrorが重複している
- for await...ofについての記述を追加 HOT 4
- Fulfilled と FulFilled の表記ゆれ HOT 4
- Move to GItHub Actions
- throwについて現実的な利用について書く
- 意図しない赤字表示になっているのではないか HOT 4
- Promise Anti-patterns へのリンクを開くとリンク広告のようなページが表示される HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promises-book.