Skip to content

Commit 9885649

Browse files
committed
feat: add unsubscribe method to Loro subscription
1 parent 562bd73 commit 9885649

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

Sources/Loro/LoroFFI.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7736,6 +7736,11 @@ public protocol SubscriptionProtocol : AnyObject {
77367736
*/
77377737
func detach()
77387738

7739+
/**
7740+
* Unsubscribes the subscription.
7741+
*/
7742+
func unsubscribe()
7743+
77397744
}
77407745

77417746
/**
@@ -7803,6 +7808,15 @@ open func detach() {try! rustCall() {
78037808
}
78047809
}
78057810

7811+
/**
7812+
* Unsubscribes the subscription.
7813+
*/
7814+
open func unsubscribe() {try! rustCall() {
7815+
uniffi_loro_fn_method_subscription_unsubscribe(self.uniffiClonePointer(),$0
7816+
)
7817+
}
7818+
}
7819+
78067820

78077821
}
78087822

@@ -14570,6 +14584,9 @@ private var initializationResult: InitializationResult = {
1457014584
if (uniffi_loro_checksum_method_subscription_detach() != 64699) {
1457114585
return InitializationResult.apiChecksumMismatch
1457214586
}
14587+
if (uniffi_loro_checksum_method_subscription_unsubscribe() != 24473) {
14588+
return InitializationResult.apiChecksumMismatch
14589+
}
1457314590
if (uniffi_loro_checksum_method_undomanager_add_exclude_origin_prefix() != 61306) {
1457414591
return InitializationResult.apiChecksumMismatch
1457514592
}

loro-rs/Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loro-rs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "loro-swift"
3-
version = "1.3.2"
3+
version = "1.3.3"
44
edition = "2021"
55

66
[lib]
@@ -14,7 +14,7 @@ path = "src/uniffi-bindgen.rs"
1414

1515

1616
[dependencies]
17-
loro-ffi = { git = "https://github.com/loro-dev/loro.git", tag = "[email protected].1" }
17+
loro-ffi = { git = "https://github.com/loro-dev/loro.git", tag = "[email protected].2" }
1818
# loro-ffi = { path = "../../loro/crates/loro-ffi" }
1919
uniffi = { version = "0.28.3" }
2020

loro-rs/src/loro.udl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,10 @@ interface Subscription{
15471547
/// subscribed to are dropped
15481548
[Self=ByArc]
15491549
void detach();
1550+
1551+
/// Unsubscribes the subscription.
1552+
[Self=ByArc]
1553+
void unsubscribe();
15501554
};
15511555

15521556
interface DiffBatch{

0 commit comments

Comments
 (0)