getDependentsFor not working in ember octane throwing maximum call stack size exceeded error
vishwasraj-thyagaraj opened this issue · comments
Environment
- Ember Version: 3.16.0
- Ember CLI Version: 3.16.1
- Ember CP Validations Version: 4.0.0-beta.10
Steps to Reproduce
EmberObject Syntax
ValidatorName.reopenClass({
getDependentsFor(attribute, options) {
return [];
}
});
Class Syntax
@classic
class ValidatorName extends BaseValidator {
static getDependentsFor(attribute) {
return []
};
}
export default ValidatorName;
Both of syntax throw this error in Octane. Is there an alternative way to achieve this, or am i doing something wrong
The solution for now is to remove getDependentsFor
and add volatile: true
, which re-computes all other dependent values from model when one value changes in the model
const Validations = buildValidations({
key1: validator('validator-name', { volatile: true }),
key2: validator('validator-name', { volatile: true })
});