From c65be21ff24330568836dccda6f2e422b425443d Mon Sep 17 00:00:00 2001 From: alteredworlds Date: Fri, 3 Feb 2023 16:37:49 +0000 Subject: [PATCH 1/3] Update docs/ArchitectureLearningJourney.md - Writing data --- docs/ArchitectureLearningJourney.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ArchitectureLearningJourney.md b/docs/ArchitectureLearningJourney.md index 6b6fa4420..9b5a0e6aa 100644 --- a/docs/ArchitectureLearningJourney.md +++ b/docs/ArchitectureLearningJourney.md @@ -192,9 +192,9 @@ Whenever the list of topics changes (for example, when a new topic is added), th To write data, the repository provides suspend functions. It is up to the caller to ensure that their execution is suitably scoped. -_Example: Follow a topic_ +_Example: Follow a set of topics_ -Simply call `TopicsRepository.setFollowedTopicId` with the ID of the topic which the user wishes to follow. +Simply call `UserDataRepository.setFollowedTopicIds` with the set of IDs of the topics the user wishes to follow. ### Data sources From 3aaef585594506e87791b90ff0ad22177e3b91bd Mon Sep 17 00:00:00 2001 From: alteredworlds Date: Fri, 3 Feb 2023 16:53:43 +0000 Subject: [PATCH 2/3] Update docs/ArchitectureLearningJourney.md - User action follow topic --- docs/ArchitectureLearningJourney.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ArchitectureLearningJourney.md b/docs/ArchitectureLearningJourney.md index 9b5a0e6aa..741c5c424 100644 --- a/docs/ArchitectureLearningJourney.md +++ b/docs/ArchitectureLearningJourney.md @@ -309,7 +309,7 @@ User actions are communicated from UI elements to ViewModels using regular metho **Example: Following a topic** -The `InterestsScreen` takes a lambda expression named `followTopic` which is supplied from `InterestsViewModel.followTopic`. Each time the user taps on a topic to follow this method is called. The ViewModel then processes this action by informing the topics repository. +The `InterestsScreen` takes a lambda expression named `followTopic` which is supplied from `InterestsViewModel.followTopic`. Each time the user taps on a topic to follow this method is called. The ViewModel then processes this action by informing the user data repository. ## Further reading From 7c6d46d85f2e82ecba1503bd6d1c9bf47f5a377a Mon Sep 17 00:00:00 2001 From: Don Turner Date: Wed, 8 Feb 2023 21:00:10 +0000 Subject: [PATCH 3/3] Apply suggestions from code review --- docs/ArchitectureLearningJourney.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ArchitectureLearningJourney.md b/docs/ArchitectureLearningJourney.md index 741c5c424..9d7c77e1c 100644 --- a/docs/ArchitectureLearningJourney.md +++ b/docs/ArchitectureLearningJourney.md @@ -192,9 +192,9 @@ Whenever the list of topics changes (for example, when a new topic is added), th To write data, the repository provides suspend functions. It is up to the caller to ensure that their execution is suitably scoped. -_Example: Follow a set of topics_ +_Example: Follow a topic_ -Simply call `UserDataRepository.setFollowedTopicIds` with the set of IDs of the topics the user wishes to follow. +Simply call `UserDataRepository.toggleFollowedTopicId` with the ID of the topic the user wishes to follow and `followed=true` to indicate that the topic should be followed (use `false` to unfollow a topic). ### Data sources