Skip to content

Instantly share code, notes, and snippets.

@meet30997
Created September 6, 2022 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meet30997/300cfd76aeb99dd292871937819664cb to your computer and use it in GitHub Desktop.
Save meet30997/300cfd76aeb99dd292871937819664cb to your computer and use it in GitHub Desktop.
Migrate Shared Preference To DataStore
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(
name = "MyDataStore",
produceMigrations = { context ->
listOf(
SharedPreferencesMigration(context, "MySharedPref")
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment