-
Notifications
You must be signed in to change notification settings - Fork 4
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
Reactivity broken for a rule dependency #16
Comments
Also, I think we should have automated tests for such cases. |
This is not a problem from regle, but reactivity on your side, as your dependency Use const extraWeightRule = (myArg: string, index: number) => {
return withMessage(
withParams((value) => {
return Number(value) > 1 && someCondition.value === false
}, [someCondition]),
t('totally_not_good', { name: myArg + index })
)
} |
There is already tests on the parameters dependencies 👍 |
|
@victorgarciaesgi Oh, I see. I think other people will run into the same "issue" and wonder why it is not working. Do you think we could add a separate section to the docs like "Reactivity caveats" or something like that to clearly explain this? |
I think it's a good idea yeah! |
👍🏻 closing this and opening a proper issue to track this in #17 |
Reactivity broken for a rule dependency
I have a rule that depends on
someCondition
ref. WhensomeCondition
changes, the rule should be re-evaluated. However, it is not. However if I change the value of the field then the rule is re-evaluated.Steps to reproduce:
Reproduction:
https://stackblitz.com/~/github.com/martinszeltins/regle-test-8
The text was updated successfully, but these errors were encountered: