init

fun init(dataStoreName: String)

Initialises the DataStore instance for the given dataStoreName.

This function is @Composable so that rememberDataStore can access platform-specific context (e.g. LocalContext on Android) without requiring the integrator to pass it explicitly.

The null guard ensures the DataStore is created exactly once — subsequent calls on recomposition are no-ops.

This function is called automatically by rememberModules for any module implementing RequiresDataStore. It should not be called manually.

Parameters

dataStoreName

The filename used for the DataStore preferences file.