Skip to content

Commit

Permalink
Add doc comment to cleanup_running
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechu10 committed Mar 10, 2021
1 parent 4915c87 commit 2ff9f1f
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions maple-core/src/reactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ impl<T> AnySignalInner for RefCell<SignalInner<T>> {
}
}

/// Unsubscribes from all the dependencies in [`Running`].
fn cleanup_running(running: &Rc<RefCell<Option<Running>>>) {
let execute = running.borrow().as_ref().unwrap().execute.clone();

Expand Down Expand Up @@ -302,16 +303,10 @@ where
effect();

// attach dependencies
for dependency in &contexts
.borrow()
.last()
.unwrap()
.borrow()
.as_ref()
.unwrap()
.dependencies
{
dependency.0.subscribe(running.borrow().as_ref().unwrap().execute.clone());
for dependency in &running.borrow().as_ref().unwrap().dependencies {
dependency
.0
.subscribe(running.borrow().as_ref().unwrap().execute.clone());
}

contexts.borrow_mut().pop();
Expand Down

0 comments on commit 2ff9f1f

Please sign in to comment.