Skip to content

Commit 1d6eb6d

Browse files
committed
little cleanup
1 parent 4ebe987 commit 1d6eb6d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

shared/src/sync_engine/new_defn.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ impl<W: TypedTransportTrait, GithubApi> SyncEngine<W, GithubApi> {
5858
.with_store::<IssueCommentsInitialSyncStatus>()
5959
.with_store::<RepositoryInitialSyncStatus>();
6060

61-
let db_change_notifiers: Rc<Registry<DbSubscription>> = Default::default();
62-
let db_change_notifiers2 = db_change_notifiers.clone();
61+
let db_subscriptions: Rc<Registry<DbSubscription>> = Default::default();
62+
let db_subscriptions2 = db_subscriptions.clone();
6363
let db = DbWithOptimisticChanges::new(
6464
db,
6565
Rc::new(move |reactivity_trackers| {
66-
let orig_trackers = db_change_notifiers2.get();
66+
let orig_trackers = db_subscriptions2.get();
6767
orig_trackers
6868
.iter()
6969
.filter(|sub| {
@@ -76,7 +76,7 @@ impl<W: TypedTransportTrait, GithubApi> SyncEngine<W, GithubApi> {
7676

7777
Ok(Self {
7878
db: Rc::new(db),
79-
db_subscriptions: SendWrapper::new(db_change_notifiers),
79+
db_subscriptions: SendWrapper::new(db_subscriptions),
8080
endpoint_client,
8181
_transport: PhantomData,
8282
})

shared/src/sync_engine/registry.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ struct Inner<T> {
88
map: HashMap<u32, T>,
99
}
1010

11+
/// The idea is that one calls `.add()` to add an object to the registry, and it
12+
/// will return a function that will remove it from the registry when called.
13+
/// And then one can do `registry.get()` to get all the objects in the registry.
1114
pub struct Registry<T> {
1215
inner: SendWrapper<Rc<RefCell<Inner<T>>>>,
1316
}

0 commit comments

Comments
 (0)