Skip to content

Commit

Permalink
Rename Subscription’s finish method to unsubscribe
Browse files Browse the repository at this point in the history
I don’t think that this method should exist at all; the intention for
our public API, as described in 20e7f5f, is that the user should not
need to explicitly unsubscribe. (We have #36 for figuring out how to
implement the appropriate cleanup.) However, this method does now exist,
and we’re probably not going to get rid of it before beta, so we agreed
in standup today to at least name it in line with JS.
  • Loading branch information
lawrence-forooghian committed Dec 4, 2024
1 parent ed4c028 commit 501a1d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/AblyChat/Subscription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public struct Subscription<Element: Sendable>: Sendable, AsyncSequence {
}

// TODO: https://github.com/ably-labs/ably-chat-swift/issues/36 Revisit how we want to unsubscribe to fulfil CHA-M4b & CHA-ER4b. I think exposing this publicly for all Subscription types is suitable.
public func finish() {
public func unsubscribe() {
switch mode {
case let .default(_, continuation):
continuation.finish()
Expand Down

0 comments on commit 501a1d5

Please sign in to comment.