Skip to content

Conversation

@DevYeom
Copy link
Owner

@DevYeom DevYeom commented Nov 2, 2025

Related Issues 💭

Description 📝

  • Add a new operator that emits elements from this effect, but only if a certain amount of time has passed between emissions.

Additional Notes 📚

enum ThrottleID {
    case button
}

func reduce(state: inout State, action: Action) -> AnyEffect<Action> {
    switch action {
    // ...
    case .perform:
        return .just(.increment)
            .throttle(id: ThrottleID.button, for: .seconds(1), latest: true)
    // ...
    }
}

Checklist ✅

  • If it's a new feature, have appropriate unit tests been added?
  • If the changes affect existing functionality, please verify whether the above information has been appropriately described.

@DevYeom DevYeom self-assigned this Nov 2, 2025
@DevYeom DevYeom merged commit a259f69 into main Nov 3, 2025
2 checks passed
@DevYeom DevYeom deleted the throttle branch November 3, 2025 12:15
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.

2 participants