Echo JS 0.11.0

<~>
bfred.it 2772 days ago. link parent 1 point
Even if you invoke them in a Promise, they're still callbacks because you expect them as arguments.

My argument is that they should not be there at all since the native .then() covers all the cases. Now you have onEndSave/onAfterSave/onError/then/catch instead of just then/catch.

Also the onBeforeSave/onStartSave callbacks are one step away from adding onBeforeStartSave, onAfterStartSave, onBeforeAfterStartSave. Why do you have two callbacks for the same event?

Do you see the problem this approach? Your API is unnecessarily wide and that makes it harder for everybody involved: harder for you to cover all the possible events and harder for the next developer to make sense of all the possible+identical ways to do one thing.

Replies