Skip to content

When is a capsule rebuilt? #214

Closed Answered by GregoryConrad
busslina asked this question in Q&A
Discussion options

You must be logged in to vote

Will capsuleA rebuild in the future if capsuleB rebuilds, even it there are no listeners for capsuleA?

There are a few possibilities here that dictate what would happen.

First, does capsuleB emit a new value (i.e., newData != oldData)? If the data returned after a rebuild happens is the same as it was before, then capsuleA remains untouched.

Now, say capsuleB does emit new data. We must then ask whether capsuleA registers any side effects (i.e., use.something())? If it does not register any side effects, then it will be disposed/removed from the container via idempotent garbage collection. If it does register a side effect, then it will in fact be rebuilt with the new value from capsuleB

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@GregoryConrad
Comment options

@busslina
Comment options

Answer selected by GregoryConrad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants