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
I think there are very valid reasons when a thing has to happen before/during/after save/create/update/etc. The real question is: would we want these things on the data model?
Looking at the vocab work, we have a term wrapper that gives us a "save" method. Adding a "before save" callback would be as easy as just putting a line of code in there (if that is our definitive object for persisting terms, anyway).
In cases where we have so little logic we don't abstract anything, a callback might indeed be the right choice. But once we're feeling like we need those abstractions, I'd say callbacks should be the exception, not the rule.
When are they appropriate? Ever? Troubles, concerns, when they work well.
The text was updated successfully, but these errors were encountered: