Using callbacks to prevent code duplication
– doeken.org - submitted by Doeke Norg
DRY up code by deferring specifics to a callback.
Read more [doeken.org]
Posts tagged with callbacks
– doeken.org - submitted by Doeke Norg
DRY up code by deferring specifics to a callback.
Read more [doeken.org]
? Did you know you could use the afterCreating and lots of other "after" callbacks on Eloquent Factories to create additional models in Laravel? https://t.co/XejFph55zO #Laravel #PHP pic.twitter.com/oc8BfpEPqN
— Dries Vints (@driesvints) May 15, 2018
Read more [twitter.com]
Join 9,500+ smart developers
Every month I share what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
JavaScript practically requires callback functions to do anything asynchronous. Unless you’re talking about generators, you really can’t get away from them. Callbacks are everywhere.http://derickbailey.com/2016/02/15/what-do-you-name-the-callback-function/...
I do use different names for the callback parameter, depending on the circumstance. I believe naming is important as it provides a set of expectations. If your code breaks the expectations of the name, people will be confused and it will cause problems.