-
Notifications
You must be signed in to change notification settings - Fork 9
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
[discussion] api naming #20
Comments
I don't think it's necessary 🤔
IMO we should just remove
Ideally, It should be private in module scope, not class scope. We have no module level public / private in Javascript, that's the point. Or, maybe we can achieve that by putting |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
If we can also remove |
It's realy matters that Function name ought start with a verb, such as getByXxx, isXxx, hasXxx
Maybe |
|
|
FYI: |
名字可以商量,有建议吗? |
This comment was marked as resolved.
This comment was marked as resolved.
|
Conclusioncontent below may change
|
Consider that most of the time we append validators like this: const state = new FieldState('').validators(...)
const formState = new FormState({
foo: new FieldState('').validators(...)
// ...
}).validators(...)
const state = new FieldState('').addValidator(...) with const state = new FieldState('').withValidator(...) |
介词 with 当动词用好吗,那下面这种情况看起来就不舒服了
另外 add 的反义词也好找点,当需要对成的接口的时候 |
@huangbinjie 不是把
这种情况可以写成 state = state.withValidator(...) 虽然确实会麻烦一点;但是对比:
显然 1 对应的场景更多,因此场景 1 下的自然程度要比场景 2 下的自然程度更重要
|
TL;DR
See conclusion in #20 (comment)
for formstate-x-next
validators
->addValidators
$
$
looks like a hack$
should not have multiple meanings in different contexts_value
->rawValue
or sth else?_
should actually be private, but have to be accessed outside formstate-x(for
bind**
not included & should not included)The text was updated successfully, but these errors were encountered: