What's the difference between async and async* in Dart?
What's the difference between async and async* in Dart?
The main difference between async and async* in Dart is the type of result they return:
async functions return a Future, representing a single asynchronous result.async* functions return a Stream, representing a sequence of asynchronous results.Here's a more detailed comparison:
asyncawait expression, then pauses until the awaited Future completes.Future that completes with the return value of the function.Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.