Write Data to Prefs DataStore | raywenderlich.com

Reading and observing data from Prefs DataStore is fine but we still need to be able to save information. In this episode learn how to write data to DataStore.

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

I’m confused as to why this approach.

Shouldn’t the PrefsStoreImpl's job be just to take a value as a parameter and store the preference? It shouldn’t be toggling it. That should be the job of the caller, in this case, the CoursesViewModel?