@@ -74,7 +74,7 @@ public operator fun CoroutineScope.plus(context: CoroutineContext): CoroutineSco
74
74
ContextScope (coroutineContext + context)
75
75
76
76
/* *
77
- * Creates [CoroutineScope] for a UI components.
77
+ * Creates the main [CoroutineScope] for UI components.
78
78
*
79
79
* Example of use:
80
80
* ```
@@ -89,9 +89,9 @@ public operator fun CoroutineScope.plus(context: CoroutineContext): CoroutineSco
89
89
*
90
90
* ```
91
91
*
92
- * Resulting scope has [SupervisorJob] and [Dispatchers.Main].
93
- * If you want to append additional elements to main scope, use [CoroutineScope.plus] operator:
94
- * `val scope = MainScope() + CoroutineName("MyActivity") `.
92
+ * The resulting scope has [SupervisorJob] and [Dispatchers.Main] context elements .
93
+ * If you want to append additional elements to the main scope, use [CoroutineScope.plus] operator:
94
+ * `val scope = MainScope() + CoroutineName("MyActivity")`.
95
95
*/
96
96
@Suppress(" FunctionName" )
97
97
public fun MainScope (): CoroutineScope = ContextScope (SupervisorJob () + Dispatchers .Main )
@@ -198,13 +198,13 @@ public fun CoroutineScope(context: CoroutineContext): CoroutineScope =
198
198
199
199
/* *
200
200
* Cancels this scope, including its job and all its children.
201
- * Throws [IllegalStateException] if scope does not have a job in it.
201
+ * Throws [IllegalStateException] if the scope does not have a job in it.
202
202
*
203
- * This API is experimental in order to investigate possible clashes with other cancellation mechanism .
203
+ * This API is experimental in order to investigate possible clashes with other cancellation mechanisms .
204
204
*/
205
205
@Suppress(" NOTHING_TO_INLINE" )
206
- @ExperimentalCoroutinesApi // Experimental and inline until 1.2
206
+ @ExperimentalCoroutinesApi // Experimental and inline since 1.1.0, tentatively until 1.2.0
207
207
public inline fun CoroutineScope.cancel () {
208
- val job = coroutineContext[Job ] ? : error(" Current scope cannot be cancelled because it does not have a job: $this " )
208
+ val job = coroutineContext[Job ] ? : error(" Scope cannot be cancelled because it does not have a job: $this " )
209
209
job.cancel()
210
210
}
0 commit comments