-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MosaicComposable annotation (#229)
The annotation is used to mark Mosaic Compose functions that cannot be used in other Compose code or for other compositions.
- Loading branch information
Showing
4 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
mosaic-runtime/src/commonMain/kotlin/com/jakewharton/mosaic/ui/MosaicComposable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.jakewharton.mosaic.ui | ||
|
||
import androidx.compose.runtime.ComposableTargetMarker | ||
|
||
/** | ||
* An annotation that can be used to mark an composable function as being expected to be use in a | ||
* composable function that is also marked or inferred to be marked as a [MosaicComposable]. | ||
* | ||
* Using this annotation explicitly is rarely necessary as the Compose compiler plugin will infer | ||
* the necessary equivalent annotations automatically. See | ||
* [androidx.compose.runtime.ComposableTarget] for details. | ||
*/ | ||
@Retention(AnnotationRetention.BINARY) | ||
@ComposableTargetMarker(description = "Mosaic Composable") | ||
@Target( | ||
AnnotationTarget.FUNCTION, | ||
AnnotationTarget.PROPERTY_GETTER, | ||
AnnotationTarget.TYPE, | ||
AnnotationTarget.TYPE_PARAMETER, | ||
) | ||
public annotation class MosaicComposable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters