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

Change: addRule removes previous rule with same name if that exists #441

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PawelStroinski
Copy link

Please see unit test. Unfortunately this is breaking change.

@crissdev
Copy link
Member

@PawelStroinski I think if you augment the rule object with a replace option and change addRule and addAnnonymousRule methods, this won't be a breaking change anymore. The starting point for this would be addExtender in this case. This would allow rules like the following to be defined:

var obsv = ko.observable().extend({required: true});
obsv.extend({required: {replace: true, params: false}});

{replace: true} would tell the API to replace the rule. Since I don't see similar functionality documented anywhere this shouldn't be considered a breaking change.

Other thoughts, anyone?

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

Successfully merging this pull request may close these issues.

None yet

2 participants