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
Today we have a single config.addRule method that configures both "simple" and "reactive" rules. I.e.
// simple rule, fired any time author is changedconfig.addRule(a=>a.firstName)// reactive rule, only fires if time author.firstName changes or books.title changeconfig.addRule({firstName: {},books: "title"},a=> ...);
It seems confusing to have a single method setup rules that are very different in runtime behavior, so we're considering removing addRule and replacing it with two methods:
addSimpleRule
addReactiveRule
Pros/cons:
Pro: More clear which semantics you're getting
Pro: Matches the new "reactive" terminology for "reactive rules" & "reactive fields"
Con: addReactiveRule is a longer name, simplicity of addRule is nice :-/
Con: Unclear when simple rules should be used over reactive rules? (See alternative)
Alternative 1
What if we kept addRule, but made all rules be reactive rules, i.e. all callers must pass a reactive hint? Basically remove simple/non-reactive rules.
Pro: Simpler mental mode, just one type of rule (reactive)
Pro: Seems like all rules should be reactive anyway?
Con: Harder to do authorConfig.addRule(newRequiredRule("firstName")), would probably change to addRequiredRule(authorConfig, "firstName").
The text was updated successfully, but these errors were encountered:
Today we have a single
config.addRule
method that configures both "simple" and "reactive" rules. I.e.It seems confusing to have a single method setup rules that are very different in runtime behavior, so we're considering removing
addRule
and replacing it with two methods:addSimpleRule
addReactiveRule
Pros/cons:
addReactiveRule
is a longer name, simplicity ofaddRule
is nice :-/Alternative 1
What if we kept
addRule
, but made all rules be reactive rules, i.e. all callers must pass a reactive hint? Basically remove simple/non-reactive rules.authorConfig.addRule(newRequiredRule("firstName"))
, would probably change toaddRequiredRule(authorConfig, "firstName")
.The text was updated successfully, but these errors were encountered: