rememberBoomerangStore

@Composable
actual fun <T : BoomerangStore> rememberBoomerangStore(init: () -> T): T(source)

Android-specific implementation of rememberBoomerangStore.

This implementation uses rememberSaveable with a custom Saver to preserve the BoomerangStore's state across configuration changes.

The Saver converts the BoomerangStore's state to an Android Bundle for saving and restores it by creating a new BoomerangStore instance and applying the saved state.

Return

The remembered BoomerangStore instance that persists across configuration changes

Parameters

T

The type of BoomerangStore to remember

init

A lambda that creates an initial instance of the BoomerangStore

@Composable
expect fun <T : BoomerangStore> rememberBoomerangStore(init: () -> T): T(source)

Remembers a BoomerangStore across recompositions and configuration changes. This function is implemented differently on each platform to ensure proper state saving and restoration.

On Android, it uses rememberSaveable with a custom saver to preserve the store's state across configuration changes. On other platforms, it uses remember to keep the store instance across recompositions.

Return

The remembered BoomerangStore instance

Parameters

T

The type of BoomerangStore to remember

init

A lambda that creates an initial instance of the BoomerangStore

@Composable
actual fun <T : BoomerangStore> rememberBoomerangStore(init: () -> T): T(source)

Desktop-specific implementation of rememberBoomerangStore.

This implementation uses the standard remember function to keep the BoomerangStore instance across recompositions. On desktop platforms, there are no configuration changes like on Android, so we don't need the more complex state saving mechanism.

Return

The remembered BoomerangStore instance

Parameters

T

The type of BoomerangStore to remember

init

A lambda that creates an initial instance of the BoomerangStore

@Composable
actual fun <T : BoomerangStore> rememberBoomerangStore(init: () -> T): T(source)

iOS-specific implementation of rememberBoomerangStore.

This implementation uses the standard remember function to keep the BoomerangStore instance across recompositions. On iOS, the app process typically doesn't undergo configuration changes like on Android, so we don't need the more complex state saving mechanism.

Return

The remembered BoomerangStore instance

Parameters

T

The type of BoomerangStore to remember

init

A lambda that creates an initial instance of the BoomerangStore