JavaScript Promiseの本 v1
Promiseの本 一方、JavaScriptにおける非同期処理といえば、コールバックを利用する場合が多いと思 います。 コールバックを使った非同期処理の一例 getAsync("fileA.txt", function(error, result){ if(error){// 取得失敗時の処理 throw error; } // 取得成功の処理 }); コールバック関数の引数には(エラーオブジェクト Promiseを使った非同期処理の一例 var promise = getAsyncPromise("fileA.txt"); promise.then(function(result){ // 取得成功の処理 }).catch(function(error){ // 取得失敗時の処理 }); promiseオブジェクトを返す 非同期処理を抽象化したpromiseオブジェクトというものを用意し、 promiseオブジェクトを作成して利用します。 promiseオブジェクトを作成するには、 Promise コンストラクタを new でインスタンス化 します。 var promise = new Promise(function(resolve, reject) { // 非同期の処理 // 処理が終わったら、resolve または rejectを呼ぶ }); Instance Method ne0 码力 | 115 页 | 1.06 MB | 1 年前3JavaScript Promiseの本 v2
.................... 108 Chapter.5 - Async Function ................................................................................... 116 Async Functionとは .......................................... ............................................... 116 Async Functionの構文 ..................................................................................... 119 await 式 ............................... ............................................................................ 121 Async Functionと配列 ..................................................................................... 124 Promises API0 码力 | 137 页 | 1.17 MB | 1 年前3PlantUML 1.2019.6 言語リファレンスガイド
@startuml !unquoted function SALT($x) "{{ salt %invoke_void_func("_"+$x) }}" as $x !endfunction !function _choose() {+ an example choose one option ()one ()two [ok] } !endfunction !function _wait() {+ please wait operation in progress <&clock> [cancel] } !endfunction !function _success() {+ success congratulations! [ok] } !endfunction !function _error() {+ error failed, sorry [ok] } !endfunction (*) finally removed in some long term future). • You should not use !define and !definelong anymore. Use !function and variable definition instead • !include allows now multiple inclusions : you don't have to use0 码力 | 174 页 | 1.99 MB | 1 年前3PlantUML 1.2019.9 言語リファレンスガイド
@startuml !unquoted function SALT($x) "{{ salt %invoke_void_func("_"+$x) }}" as $x !endfunction !function _choose() {+ an example choose one option ()one ()two [ok] } !endfunction !function _wait() {+ please wait operation in progress <&clock> [cancel] } !endfunction !function _success() {+ success congratulations! [ok] } !endfunction !function _error() {+ error failed, sorry [ok] } !endfunction (*) and !definelong anymore. Use !function and variable definition instead. !define should be replaced by return function and !definelong should be replaced by void function. • !include now allows multiple0 码力 | 175 页 | 2.02 MB | 1 年前3PlantUML 1.2020.23 言語リファレンスガイド
を使わないようにしてください (将来的に削除される可能性があります)。 • !define と!definelong は使用しないでください。代わりに!function`、!procedure?code?? もし くは変数定義を使用します。 – !define は return!function に置き換えてください。 – !definelong は!procedure に置き換えてください。 • !include destroyed when the procedure ends. 20.7 Return function [!function, !endfunction] A return function does not output any text. It just define a function that you can call: • directly in variable definition • from other return functions • from procedures • Function name should start with a $ • Argument names should start with a $ @startuml !function $double($a) !return $a + $a PlantUML 言語リファレンスガイド (10 码力 | 306 页 | 3.19 MB | 1 年前3PlantUML を使った UML の描き方 - PlantUML 言語リファレンスガイド(Version 1.2020.22)
を使わないようにしてください (将来的に削除される可能性があります)。 • !define と!definelong は使用しないでください。代わりに!function`、!procedure?code?? もし くは変数定義を使用します。 – !define は return!function に置き換えてください。 – !definelong は!procedure に置き換えてください。 • !include destroyed when the procedure ends. 20.7 Return function [!function, !endfunction] A return function does not output any text. It just define a function that you can call: • directly in variable definition • from other return functions • from procedures • Function name should start with a $ • Argument names should start with a $ @startuml !function $double($a) !return $a + $a PlantUML 言語リファレンスガイド (10 码力 | 294 页 | 3.11 MB | 1 年前3Comprehensive Rust(日语) 202412
28 • Rust uses macros for situations where you want to have a variable number of arguments (no function overloading). • Macros being 'hygienic' means they don't accidentally capture identifiers from 8 � 7 8 9 � 3 6 9 Copy the code below to https://play.rust-lang.org/ and implement the function. This function only operates on 3x3 matrices. // TODO: 実装が完了したら、これを削除します。 fn transpose(matrix: [[i32; a specialized instance of the function for each different type that the generic is instantiated with. This means that calling a trait method from within a generic function still uses static dispatch, as0 码力 | 381 页 | 1.36 MB | 10 月前3PlantUML を使った UML の描き方 - PlantUML 言語リファレンスガイド(Version 1.2021.1)
を使わないようにしてください (将来的に削除される可能性があります)。 • !define と!definelong は使用しないでください。代わりに!function`、!procedure?code?? も しくは変数定義を使用します。 – !define は return!function に置き換えてください。 – !definelong は!procedure に置き換えてください。 • !include $addCommonMethod() toString() hashCode() PlantUML 言語リファレンスガイド (1.2021.1) 348 / 392 24.7 Return function [!function, !endfunction] 24 前処理 !endprocedure $init_class("foo1") $init_class("foo2") $msg("foo1", destroyed when the procedure ends. 24.7 Return function [!function, !endfunction] A return function does not output any text. It just define a function that you can call: • directly in variable definition0 码力 | 393 页 | 4.27 MB | 1 年前3PlantUML を使った UML の描き方 - PlantUML 言語リファレンスガイド(Version 1.2021.2)
を使わないようにしてください (将来的に削除される可能性があります)。 • !define と!definelong は使用しないでください。代わりに!function`、!procedure?code?? も しくは変数定義を使用します。 – !define は return!function に置き換えてください。 – !definelong は!procedure に置き換えてください。 • !include $addCommonMethod() toString() hashCode() PlantUML 言語リファレンスガイド (1.2021.2) 354 / 398 25.7 Return function [!function, !endfunction] 25 前処理 !endprocedure $init_class("foo1") $init_class("foo2") $msg("foo1", destroyed when the procedure ends. 25.7 Return function [!function, !endfunction] A return function does not output any text. It just define a function that you can call: • directly in variable definition0 码力 | 399 页 | 4.33 MB | 1 年前3PlantUML 1.2021.3 言語リファレンスガイド
を使わないようにしてください (将来的に削除される可能性があります)。 • !define と!definelong は使用しないでください。代わりに!function`、!procedure?code?? も しくは変数定義を使用します。 – !define は return!function に置き換えてください。 – !definelong は!procedure に置き換えてください。 • !include $addCommonMethod() toString() hashCode() PlantUML 言語リファレンスガイド (1.2021.2) 366 / 411 25.7 Return function [!function, !endfunction] 25 前処理 !endprocedure $init_class("foo1") $init_class("foo2") $msg("foo1", destroyed when the procedure ends. 25.7 Return function [!function, !endfunction] A return function does not output any text. It just define a function that you can call: • directly in variable definition0 码力 | 412 页 | 4.46 MB | 1 年前3
共 21 条
- 1
- 2
- 3