Giter VIP home page Giter VIP logo

Comments (12)

azu avatar azu commented on May 18, 2024

章、セクション

セクションって言葉は途中から使い始めた気がする。
どこかで混ざってそう

from promises-book.

azu avatar azu commented on May 18, 2024

事、こと

結構混ざってる感あるというか、IME的に統一して書くの難しい

from promises-book.

azu avatar azu commented on May 18, 2024

FulFilled または Rejected

💡 この用語の混乱する原因は

Promiseコンストラクタで(executor functionである)resolveが呼ばれた -> (promiseオブジェクトが)Fulfilledとなった -> onFulfilledが呼ばれる

という対象が途中で変わってる所にあるから、最初の説明にこの流れ自体をちゃんと書いてあげるのがいいと思う。

from promises-book.

azu avatar azu commented on May 18, 2024

主語がPromiseの場合はresolve and reject
(Promiseがresolveした時)

主語がpromiseオブジェクトの場合はFulfilled and Rejected.
(promiseオブジェクトがFulfilledとなった時)


後、resolve(解決) と reject(棄却)としてるけど、
素直に成功と失敗に統一した方が直感的な気がする。

from promises-book.

azu avatar azu commented on May 18, 2024

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.

azu avatar azu commented on May 18, 2024

https://github.com/azu/promises-book/blob/master/CONTRIBUTE.md

に表現についてを追加した。

from promises-book.

azu avatar azu commented on May 18, 2024

利用者、ユーザー

利用者 - ライブラリの利用者という感じで使う。
ユーザーよりも利用者の方がイメージがつきやすいので、利用者を優先する

from promises-book.

azu avatar azu commented on May 18, 2024

(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.

azu avatar azu commented on May 18, 2024

コミットメッセージについて特に何も決めてなかったけど、
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.

azu avatar azu commented on May 18, 2024

https://github.com/azu/promises-book/blob/master/CONTRIBUTE.md

にコミットメッセージを追加した

from promises-book.

azu avatar azu commented on May 18, 2024

Asciidoctor に依存した書き方を使っていい事を追記した

from promises-book.

azu avatar azu commented on May 18, 2024

https://github.com/azu/textlint-plugin-asciidoc-loose と textlintを使って簡単にはチェックしてる

from promises-book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.