Android DataStore, Episode 4: Read Data from Prefs DataStore | raywenderlich.com

Now that you have created your Prefs Datastore it is time to use it. In this episode learn how to read and observe data from Prefs DataStore using your ViewModels.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/20555043-android-datastore/lessons/4

Please why not inject the datastore object directly instead of the context?

One of the limitations of shared preferences that data store overcomes as mentioned at the beginning of the course is threading. I don’t see that being handled here. Shouldn’t we specify the dispatcher the isNightMode flow executes on?