Skip to content

Commit

Permalink
Merge pull request #476 from egorikftp/feature/add_key_into_rememberB…
Browse files Browse the repository at this point in the history
…alloonBuilder

Add optional key into rememberBalloonBuilder
  • Loading branch information
skydoves authored Aug 27, 2023
2 parents 2d2050f + 412e532 commit d4a112d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion balloon-compose/api/balloon-compose.api
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final class com/skydoves/balloon/compose/ComposableSingletons$BalloonComp
}

public final class com/skydoves/balloon/compose/RememberBalloonBuilderKt {
public static final fun rememberBalloonBuilder (Landroid/content/Context;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)Lcom/skydoves/balloon/Balloon$Builder;
public static final fun rememberBalloonBuilder (Ljava/lang/Object;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)Lcom/skydoves/balloon/Balloon$Builder;
public static final fun rememberBalloonWindow (Lcom/skydoves/balloon/compose/BalloonWindow;Ljava/lang/Object;Landroidx/compose/runtime/Composer;II)Landroidx/compose/runtime/MutableState;
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ internal annotation class BalloonDsl
/**
* Create and remember [Balloon.Builder].
*
* @param key The key that may trigger recomposition.
* @param context context to create balloon.
* @param block a receiver lambda that will be applied with [Balloon.Builder].
*/
@Composable
@BalloonDsl
public fun rememberBalloonBuilder(
key: Any? = null,
context: Context = LocalContext.current,
block: Balloon.Builder.() -> Unit,
): Balloon.Builder = remember {
): Balloon.Builder = remember(key) {
Balloon.Builder(context).apply(block)
}

Expand Down

0 comments on commit d4a112d

Please sign in to comment.