File tree 1 file changed +11
-2
lines changed 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -11,18 +11,22 @@ pub trait UiFutureExt: Future + Sized {
11
11
///
12
12
/// ```rust
13
13
/// # async fn my_async_fn() {}
14
+ /// # let _ = async {
14
15
/// use async_ui_web_core::combinators::UiFutureExt;
15
16
/// let fut = my_async_fn().pend_after::<std::convert::Infallible>();
16
17
/// fut.await; // will never finish
18
+ /// # };
17
19
/// ```
18
20
///
19
21
/// `f.pend_after()` is equivalent to
20
22
/// ```rust
21
23
/// # let f = async {};
24
+ /// # async { let _: i32 =
22
25
/// async {
23
26
/// f.await;
24
- /// std::future::pending()
27
+ /// std::future::pending().await
25
28
/// }
29
+ /// # .await; };
26
30
/// ```
27
31
fn pend_after < T > ( self ) -> PendAfter < Self , T > {
28
32
PendAfter {
@@ -34,13 +38,18 @@ pub trait UiFutureExt: Future + Sized {
34
38
///
35
39
/// `f.meanwhile(g)` is equivalent to
36
40
/// ```rust
37
- /// # let (f, g) = (async {}, async{});
41
+ /// # let (f, g) = (async {}, async {});
38
42
/// # use async_ui_web_core::combinators::{UiFutureExt, race};
43
+ /// # async {
39
44
/// race((
40
45
/// f,
41
46
/// g.pend_after()
42
47
/// ))
48
+ /// # };
43
49
/// ```
50
+ ///
51
+ /// Use this to display UI as side-effect of some async execution.
52
+ /// For example, `load_data().meanwhile(spinner()).await`.
44
53
fn meanwhile < F : Future > (
45
54
self ,
46
55
effect : F ,
You can’t perform that action at this time.
0 commit comments