Skip to content

Commit 4b5df29

Browse files
committed
Gardening
1 parent 451a7b7 commit 4b5df29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Atoms/Core/StoreContext.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ internal struct StoreContext {
5353

5454
// Add an `Edge` from the upstream to downstream.
5555
store.graph.dependencies[transaction.key, default: []].insert(key)
56-
let (isInserted, _) = store.graph.children[key, default: []].insert(transaction.key)
56+
57+
let isInserted = store.graph.children[key, default: []].insert(transaction.key).inserted
5758
let (isNew, value) = getValue(of: atom, for: key)
5859

5960
if isInserted || isNew {
@@ -83,6 +84,7 @@ internal struct StoreContext {
8384

8485
// Register the subscription to both the store and the container.
8586
container.subscriptions[key] = subscription
87+
8688
let isInserted = store.state.subscriptions[key, default: [:]].updateValue(subscription, forKey: container.key) == nil
8789
let (isNew, value) = getValue(of: atom, for: key)
8890

0 commit comments

Comments
 (0)