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

Explore allowing multiple shims #24

Open
Macrofig opened this issue Apr 22, 2016 · 1 comment
Open

Explore allowing multiple shims #24

Macrofig opened this issue Apr 22, 2016 · 1 comment

Comments

@Macrofig
Copy link
Contributor

There may be some cases (rare) that you would need two different shims (or more). The problem right now is that the last registered shim wins. Since can is global and can-validate attaches to can.validate, anything done to can.validate is carried over to all instances where can-validate is used.

If can-validate instead used a factory pattern, we could pass whatever shim we wanted for that given instance.

Not sure if this is a good idea or a bad idea. It might not even be that big of a deal. Either way, I'd like to come up with a decision for this because it really defines how can-validate should be used.

@mickmcgrath13
Copy link

@Macrofig I agree with this thought. Consider modular, open-sourced Maps that have their own validation built in. Community users could simply find the Map/Model they need and pull it in without worrying about having to refactor the validations.

How to implement, on the other hand, is not as clear to me at this time... :P

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

No branches or pull requests

2 participants