-
Notifications
You must be signed in to change notification settings - Fork 176
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
Confusing updateModel
name
#302
Comments
ping @akre54. Are you guys still maintaining this? |
Sorry, away on vaca... Stickit is on low-maintenance mode. Any quick and easy changes we can make will be accepted, big changes should necessitate a fork. I'd rather not introduce a backwards-incompatible change like this, this late in the game. Can we maybe make the docs clearer in these areas? |
Ah alright, no problem. We could add |
Aliases are confusing, but maybe in this case deprecating the former name would be ok (so long as we keep both around). A PR would be great. |
So, funny story. About a year ago I wrote a really complex form. I haven't touched the form or Stickit since then. A bug was being reported, and we were seeing some weird behavior with (a) model changes being triggered twice, and (b) what i thought was a custom "set this dom change to this model attribute in this way" function had unintended side-effects.
We loop through certain fields in a
model
, and for each one add a binding to our form, the hash looks like this:The confusing bit is, we misused the
updateModel
hook to run custom setter logic, without returningfalse
, causing the model update logic to run again (both in our ownsetCredentials
method, and because of not returning false instickit
core).I feel this should be solved in the following way, and would love your input before I open a PR this week:
updateModel
toshouldModelUpdate
setVal
hook to change how attributes are being setThe text was updated successfully, but these errors were encountered: