You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2023. It is now read-only.
Validators are registered into a global namespace with iron-meta. This is very restrictive.
Eg. consider I want to implement a date validator that takes a format string as an argument. But validators have to be stateless basically. If you register this validator with different settings but the same name, only the last applied setting will take effect. The caller would have to remember to always use a different name for different instances. But that is complicated and error prone.
Or, in a big application, different validators with the same name might get registered and that would lead to strange errors. It may even be very hard to solve if 3rd party libraries are involved.
One way to solve this would be component-scoped validator registration. This even fits better with the web component paradigm. Additionally, it would be nice to support binding a validator function, instead of a name, directly into iron-validatable-behavior. This skips the entire registration problem, but doesn't solve it of course.
The text was updated successfully, but these errors were encountered:
Validators are registered into a global namespace with iron-meta. This is very restrictive.
Eg. consider I want to implement a date validator that takes a format string as an argument. But validators have to be stateless basically. If you register this validator with different settings but the same name, only the last applied setting will take effect. The caller would have to remember to always use a different name for different instances. But that is complicated and error prone.
Or, in a big application, different validators with the same name might get registered and that would lead to strange errors. It may even be very hard to solve if 3rd party libraries are involved.
One way to solve this would be component-scoped validator registration. This even fits better with the web component paradigm. Additionally, it would be nice to support binding a validator function, instead of a name, directly into iron-validatable-behavior. This skips the entire registration problem, but doesn't solve it of course.
The text was updated successfully, but these errors were encountered: