Skip to content

feat: add feeds.follow.updated handler & cleanup#83

Merged
arnautov-anton merged 2 commits intomainfrom
feat/follow-state-updated
Jul 30, 2025
Merged

feat: add feeds.follow.updated handler & cleanup#83
arnautov-anton merged 2 commits intomainfrom
feat/follow-state-updated

Conversation

@arnautov-anton
Copy link
Contributor

@arnautov-anton arnautov-anton commented Jul 28, 2025

🎫 Ticket: https://linear.app/stream/issue/REACT-497
🎫 Ticket: https://linear.app/stream/issue/REACT-483

💡 Overview

  • introduced handleFollowUpdated handler
  • moved feed-related handlers to feed/event-handlers
  • transformed handler methods to functions which can be bound to feed instances (this allows them to be *private, reusable, detached from the instance itself and testable)
  • created reusable response generators

*private - not publicly exported

@arnautov-anton arnautov-anton force-pushed the feat/follow-state-updated branch from 2e36720 to 8081997 Compare July 28, 2025 18:27
} from '../../state-updates/state-update-queue';
import { isFeedResponse } from '../../type-assertions';

export const updateStateFollowDeleted = (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@szuperaz - I kept these as there are already tests you wrote for it but I'm going to create a different set of tests for the handleFollowUpdated - we can re-adjust if we don't agree on the approach (I'm going to be following the approach we chose for Thread class in chat).

On a side note; I just moved everything that was related together, I feel like this way it's easier to follow.

@arnautov-anton arnautov-anton force-pushed the feat/follow-state-updated branch from 8081997 to d874136 Compare July 29, 2025 08:54
import { FollowResponse } from '../../gen/models';
import { shouldUpdateState } from '../../state-updates/state-update-queue';

describe(handleFollowUpdated.name, () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what I had in mind. We could even create a test fixture that'd make the setup much easier and highly reusable.

@arnautov-anton arnautov-anton force-pushed the feat/follow-state-updated branch from a0467cb to bffc61b Compare July 29, 2025 15:32
@arnautov-anton arnautov-anton marked this pull request as ready for review July 29, 2025 15:55
@arnautov-anton arnautov-anton force-pushed the feat/follow-state-updated branch from 4c52015 to 7fe04a3 Compare July 29, 2025 16:04
@arnautov-anton arnautov-anton force-pushed the feat/follow-state-updated branch from 7fe04a3 to 7d57f2d Compare July 30, 2025 09:32
@arnautov-anton arnautov-anton changed the title feat: add feeds.follow.updated handler feat: add feeds.follow.updated handler & cleanup Jul 30, 2025
@arnautov-anton arnautov-anton merged commit 9f296b8 into main Jul 30, 2025
6 of 7 checks passed
@arnautov-anton arnautov-anton deleted the feat/follow-state-updated branch July 30, 2025 09:45
arnautov-anton added a commit that referenced this pull request Aug 4, 2025
### 💡 Overview

Forgot to do this in #83 so I'm adding it in a separate PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants