Android DataStore, Episode 4: Read Data from Prefs DataStore |

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

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?