- プログラミング言語 Rust 4
27 :デフォルトの名無しさん[sage]:2017/10/21(土) 16:07:39.00 ID:guA6ZzKE - rocketワイも気になるンゴ
|
- 次世代言語Part7[Go Rust Swift Kotlin TypeScript]
53 :デフォルトの名無しさん[sage]:2017/10/21(土) 19:06:53.76 ID:guA6ZzKE - コンストラクタ非同期にしたい時は>>51の言ってる問題があるから、値をセットするだけのprivate constructor準備してpublicは別に公開したほうがいい
例↓ class Hoge{ private constructor(public foo:string){} async create():Promise<Hoge>{ const foo=await asyncFunction(); return new Hoge(foo); } }
|
- プログラミング言語 Rust 4
29 :デフォルトの名無しさん[sage]:2017/10/21(土) 22:00:10.66 ID:guA6ZzKE - あ
|