Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: force lazyStateGetterSettter dependents to rebuild on state change #34

Merged
merged 1 commit into from
Dec 24, 2023

Conversation

GregoryConrad
Copy link
Owner

@GregoryConrad GregoryConrad commented Dec 24, 2023

Also fixes #32

@GregoryConrad GregoryConrad merged commit 42d37d1 into main Dec 24, 2023
2 checks passed
@GregoryConrad GregoryConrad deleted the state-getter-setter-dependents-fix branch December 24, 2023 00:58
@busslina
Copy link

So now we have to take care that we have always the last version of the getter. To not cache it

@busslina
Copy link

busslina commented Dec 24, 2023

I propose you an alternative solution. To specify in the API.rebuild() a false by default argument to disable equality check.

Maybe not possible due to the design, which I haven't readed yet.

I have to review my code, but maybe I was catching the getter somewhere.

What do you think about this?

@busslina
Copy link

But I understand it could be tricky and a bad practice.

@GregoryConrad
Copy link
Owner Author

So now we have to take care that we have always the last version of the getter. To not cache it

You can use whatever version of the getter you like; they’ll all work. Only issue is the reactivity of dependencies, which is why I made that change yesterday. Feel free to cache it, just be careful t that you don’t then return a cached copy as your capsule’s data.

To specify in the API.rebuild() a false by default argument to disable equality check.

This will result in the same issue, but just pushed down to the next level of capsules (unless you force rebuild the entire dependents subgraph, but I don’t really think that’s a good idea).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC CHANGE PROPOSAL]
2 participants