Dart language support async/await programming style, or similar?

This question already has an answer here:

  • Async/Await feature in Dart 1.8 1 answer

  • Not for now. See issue Support for "await" in Dart.


    Basic support is already available.
    See https://www.dartlang.org/articles/await-async/ for more details.

    main() async {
      print(await foo());
      try {
        print(await fooThrows());
      } catch(e) {
        print(e);
      }
    }
    
    foo() async => 42;
    
    fooThrows() async => throw 'Anything';
    
    链接地址: http://www.djcxy.com/p/72636.html

    上一篇: 在VBA中评估()

    下一篇: Dart语言支持异步/等待编程风格,或类似?